In general, a couple of rules are used:
- All custom keybindings start with
<Leader>
. <Leader>x
is used as an 'extension' to provide more options for bindings.- In some cases, multiple bindings are used for a single letter (e.g.
<Leader>q
and<Leader>Q
). In those cases, the capitalized version is always used for commands that have more side-effects (e.g.<Leader>q
closes one window,<Leader>Q
closes all windows).
;
- The Leader key. Used in any binding where "<Leader>
" is present.
e.g. in Command-T below, where <Leader>t
is listed, that is (by default) a mapping for ";t
". The Leader key can be changed in ~/.vimrc
.
<Leader>ss
- start spelling on buffer.
<Leader>q
- quit the current window.
<Leader>Q
- quit all windows (exit this vim session)
<Leader>w
- write the current buffer (save).
<Leader>W
- write the current buffer and quit the current window.
<Leader>h
- move to the window to the left of the current window.
<Leader>j
- move to the window below the current window.
<Leader>k
- move to the window above the current window.
<Leader>l
- move to the window to the right of the current window.
<ctrl>x
- cut
<ctrl>c
- copy
<ctrl>v
- paste
<ctrl>s
- save
<ctrl>z
- undo
<ctrl>y
- redo
<ctrl>a
- select all
<Leader>a
- Prompt you for a string to :Ack!
<Leader>b
- display the buffers list
<Leader>gs
- Display git status.
<Leader>gb
- Display git blame.
<Leader>gl
- Display git log.
<Leader>gd
- Display git diff.
<Leader>gnc
- Git svn dcommit.
<Leader>gnr
- Git svn rebase.
<Leader>u
- Toggle Gundo
<Leader>d
- Toggle NERDTree
<Leader>p
- Run :Prefixr on the selection
<Leader>rc
- runs script/console
<Leader>rg
- runs script/generate
<Leader>rs
- runs script/server (or restarts it as necessary)
<Leader>ri
- runs the migration inversion command
<Leader>ra
- open an "alternate" file
<Leader>rr
- open a "related" file
cs'"
- e.g. replace surrounding single-quotes (') with double-quotes (").
ds"
- e.g. remove the surrounding double-quotes (").
ys[motion]"
- e.g. surround the text identified by [motion] with double-quotes ("). 1
<Leader>s
- expands snippets that start by current word
<Leader>t
- Toggle Tagbar
<Leader>tl
- Scan for Tasks
<Leader>v
- to validate the current buffer
Footnotes
-
use :help text-objects for more information about available motions. ↩