This is a complete Vim configuration that I'm using everywhere
Plugins that are available form a git repository were added with Braid for easy upgrading.
Some help tips are provided for some of the plugins. please check out the plugin's docs for more info.
From your homedirectory (on Linux/Mac OSX):
-
git clone git://github.com/astrails/dotvim.git
-
ln -sfn dotvim .vim
-
ln -sfn dotvim/vimrc .vimrc
-
you create and edit ~/.vim_local if you want to have your some local/personal settings you don't want to commit into the repo
-
If you want to use command-t file finder plugin you need to compile native extension first. just run
make
at the top of .vim directory
Note: if you alrady have ~/.vim
~/.vimrc
REMOVE THEM (you might want to backup them ifirst :)
,
is used as mapleader
,e
mapped to:e **/
. essentially you do,efoo<tab>
to get a list of all files starting with foo,s
- toggle invisible characters displayCtrl-E
- switch between 2 last buffers (its just a:b#<cr>
:)Ctrl-N
to cancel current search highlighing
Check out the 'vimrc' file for more...
-
nerdtree (github)
hax0r vim script to give you a tree explorer
Ctrl-P
- open directory browser,p
- to find and highlight the currently open file in the tree
-
nerdcommenter (github)
Vim plugin for intensely orgasmic commenting
,/
- toggle comment,cc
- add commenting,cu
- Uncomment- check docs for more
-
command-t 1.0 (vim.org git)
TextMate Command-T like file finder for vim
,,
- find file- while at the finder prompt:
Ctrl-Enter
- open file in a new splitCtrl-s
- open file in a new splitCtrl-v
- open file in a new vertical splitCtrl-U
- clear current partial pathEsc
- calcelCtrl-c
- cancel
-
autocomplpop 2.14.1 (vim.org)
Automatically opens popup menu for completions
Shouldn't require config.
-
taglist (vim.org)
Source code browser (supports C/C++, java, perl, python, tcl, sql, php, etc)
,t
- toggle tags window
-
minibufexpl 6.3.2 (vim.org)
Elegant buffer explorer - takes very little screen space
,b
to open buffer list window.Enter
in the list window to open the buffer
-
yankring 100 (vim.org)
Maintains a history of previous yanks, changes and deletes
,y
to show the yankring,[
/,]
- to cycle the just-pasted text though the yankring.:h yankring.txt
and:h yankring-tutorial
for more
-
fugitive (github)
A Git wrapper so awesome, it should be illegal
-
:Gstatus
Bring up the output of git-status in the preview window. Press
-
to stage or unstage the file on the cursor line. Pressp
to do so on a per hunk basis (--patch). PressC
to invoke |:Gcommit|. -
:Gcommit [args]
A wrapper around git-commit.
-
:Ggrep [args]
|:grep| with git-grep as 'grepprg'.
-
:Gblame
Run git-blame on the file and open the results in a scroll bound vertical split. Press enter on a line to reblame the file as it was in that commit.
Much more in the plugin's doc
-
-
Ruby on Rails: easy file navigation, enhanced syntax highlighting, and more
:AV
- open "alternate" file in a new vertical split:AS
- open "alternate" file in a new horizontal split:RV
- open "related" file in a new vertical split:RS
- open "related" file in a new horizontal split:Rextract
- extract partial (select text for extraction first):Rinvert
- takes a self.up migration and writes a self.down.gf
- remapped to take context into account. recognizes models associations, partials etc.:h rails
for more info ;)
-
syntastic (github)
syntax checking plugin
it will display the number of syntax errors in the current file in the vim's status line.
use
:Errors
to display a window detailing the errors -
TextMate-style snippets for Vim
write a snipped text and press TAB to expand it.
To see the list of available snippets type
Ctrl-R <Tab>
in the insert mode -
space (github)
Smart Space key for Vim
press SPACE to repeat last motion command
-
Delete/change/add parentheses/quotes/XML-tags/much more with ease
dsX
- delete surround XcsXY
- change surround X with Ys/S
in visual mode - wrap selectionysMovementX
- surround movement with X
You should REALLY read the docs if you want to use this one
-
Align and AlignMaps lets you align statements on their equal signs, make comment boxes, align comments, align declarations, etc.
,t=
- align on =,tsp
- align on whitespace,t,
- align on commas,t|
- align on vertical bars,acom
- align comments (C/C++):AlignSEPARATORS
- align on separators:h align
- see help for more options
-
conque (vim.org)
Conque is a Vim plugin allowing users to execute and interact with programs, typically a shell such as bash, inside a buffer window.
This one is much better then vimsh that I was using before
,sh
- start a vimsh window,r
- opens vim prompt for command to run -
A colorscheme strangely reminiscent of Vibrant Ink for a certain OS X editor
-
sessionman (vim.org)
work with Vim sessions by keeping them in the dedicated location and by providing commands to list, open, and save sessions.
,S
,:SessionList
- list sessions,SS
,:SessionSave
- save session,SA
,:SessionSaveAs
- save new session- check out "Sessions" submenu under "File"
-
This plugin is a front for the Perl module App::Ack. Ack can be used as a replacement for 99% of the uses of grep.
:Ack [options] {pattern} [{directory}]
- grep for the pattern in side directory and open result in a QuickFix window:Ack --ruby ...
- search only ruby files.:h Ack
- more help about Ack
-
pathogen 1.2 (vim.org) (github)
Allows to separate each plugin into its own subdirectory.
~/.vim/bundles
directory is used as the common root for all the plugins.Already configured
-
misc-lang-settings
ts/sw/et settings for various filetypes
-
Wisely add "end" in ruby, endfunction/endif/more in vim script, etc
-
delimitMate (vim.org) (github)
auto-completion for quotes, parens, brackets, etc. in insert mode.
-
kwdbi 1.1 (vim.org)
Keep Window on Buffer Delete - Improved
-
integration with http://pastie.org
-
Use the repeat command "." with supported plugins
-
showmarks 2.2 (vim.org)
Visually shows the location of marks.
-
unimpaired (github)
pairs of assorted bracket maps
-
tmux
tmux syntax suupport (extracted from tmux-1.1)
-
rcov
rcov support (extracted from rcov-0.8.1.2.0 ruby gem)
-
puppet (vim.org)
Syntax Highlighting for Puppet
-
json 0.4 (vim.org)
synntax highlighting file for JSON
-
cucumber (github)
syntax, indent, etc. for Cucumber
-
HAML syntax etc.
-
markdown (github)
syntax for Markdown
-
coffe-script (github)
syntax for Coffee script
The following is a list of commands and key bindings that I personally find interesting stored for easy refreshing my memory of them. there is no much 'system' to it, just randomly chosen bits of vim goodness.
ga
print ascii value of character under the cursorg#
like "#", but without using "<" and ">"g<
display previous command outputzt
scroll cursor line to topzz
scroll cursor line to centerzb
scroll cursor line to bottomCTRL-W x
exchange current window with n-th window (or next if no count given)gv
reselect last selectiongt
next tabgT
prev tabci
change inside delimitersdi
delete inside delimiters@@
execute last macro