##motions
h count characters left
l count characters right
^ to the first character of the line
$ to the last character of the line
f<char> to t he counth character occurrence to the right
F<char> to t he counth character occurrence to the left
t<char> to 1 character just before the counth character occurrence to the right
T<char> to 1 character just before the counth character occurrence to the left
w count words to the right
W count words to the left
e forward to the end of a word count
b backward to the end of a word count
i<{<"'> inside something like inside brackets or parenthesis for example
| trigger | effect |
|---|---|
| c<motion> | change |
| d<motion> | delete |
| y<motion> | yank into register |
| g~<motion> | swap case |
| gu<motion> | make lowercase |
| gU<motion> | make uppercase |
<motion> | shift right
<<motion> | shift left
=<motion> | auto-indent
| command | effect |
|---|---|
| v | enable characterwise Visual mode |
| V | enable linewise Visual mode |
| <C-v> | enable blockwise Visual mode |
| gv** | reselect the last visual selection |
| o | go to other end of highlighted text |
<C-^> or <C-6> switch to the buffer you just left
##split windows
<C-w>s split file horizontally
:sp[lit] <file>
<C-w>v split file vertically
:vsp[lit] <file>
<C-w>w cycle between open windows
<C-w>h focus the window to the left
<C-w>j focus the window below
<C-w>k focus the window above
<C-w>l focus the window to the right
:cl[ose] <C-w>c close the active window
:on[ly] <C-w>o keep only the active window, closing all others
##ctags
| command | effect |
|---|---|
| :!ctags -R | jump to first tag that matches word under the cursor |
| <C-]> | Prompt user to select from multiple matches for the word under the cursor. |
| g<C-]> | present a list of choices if there is more than a single tag to jump to |
| <C-t> | like the back button for tag history |
| :tag <keyword> | jump to first tag that matches word under the cursor |
| :tjump <keyword> | Prompt user to select from multiple matches for the word under the cursor. |
| :pop or <C-t> | Prompt user to select from multiple matches for the word under the cursor. |
| :tselect | Prompt user to choose an item from the tag matchlist |
##spelling
]s Jump to next spelling error
[s Jump to previous spelling error
z= Suggest corrections for current word
zg Add the current word to spell file
zw Remove the current word from spell file
##miscellaneous
"+p paste from system clipboard
:0,$d delete every line in a file
##quickfix window
:copen Open the quickfix window
:ccl Close it
:cw Open it if there are "errors", close it otherwise (some people prefer this)
:cn Go to the next error in the window
:cnf Go to the first error in the next file
:cc<num> Go to the error by number
##Addon References
###tcomment###
gc{motion} Toggle comments (for small comments within one line the &filetype_inline style will be used, if defined)
gcc Toggle comment for the current line
gC{motion} Comment region
gCc Comment the current line
<c- _ ><c- _ > :TComment
<c- _ >b :TCommentBlock
###vim-rails###
:A Alternate
:R Related
:Rmodel
:Rview
:Rcontroller
:help rails-navigation
###vim-surround###
cs<current><new> change old delimeter to new
ds remove delimeters
ysiw<delimiter> wrap current word
S<delimiter> while in visual mode
S= in visual mode, rails ERB tag (requires vim-rails)
S- in visual mode, rails ERB tag (requires vim-rails)
S# in visual mode, rails ERB tag (requires vim-rails)
<C-s>= rails ERB tag (requires vim-rails)
<C-s>- rails ERB tag (requires vim-rails)
<C-s># rails ERB tag (requires vim-rails)