Some of the shortcuts I find useful in Vim, but sometimes I fail to remember some of them :-)


gj and gk - move down and up by virtual lines
gg - beginning of the file
G - end of file
25G - 25th line
w - beginning of the next word
W - beginning of the next word, delimited by space
e - end of the word
b - beginning of the word
B - beginning of the word, delimited by space
% - matching parentheses
0 - beginning of the line (^ also works)
$ - end of line


o - insert below current line
O - insert above current line
A - append to the current line


- - next word under the cursor 
# - previous word under the cursor
/word - search for the word
   n/N - next/previous match

Search and replace

:s/word/newword/g - works similar to sed, valid for only the current line
:%s/word/newword/g - works on the whole file


:sp - horizontal split
:vsp - vertical split
^W + h|j|k|l - moving between windows


q<REGISTER><COMMAND>q # Record the macro
@<REGISTER> # replay the macro