Most useful vi commands.

Primary Commands
d  delete
y  copy
c  change
r  replace
p  paste
u  undo
a  append
o  new line
x  delete char
control-R  redo

dd dw d4j  delete line, delete word, delete 5 lines
yy yw  copy line, copy word
p  paste a line
:s/a/b/  replace a with b

h j k l  left, down, up right, one character/line at a time
w b e  next word, back word, end of word
W B E  same, but ignores punctuation
gg  beginning of file
G  end of File
0  first column in a line
^  beginning of line
$  end of line
/  enter a string, searches for string
control-U  page up
control-B  page down
100G – goto line 1000

Escape  command mode
i  insert mode
v  visual mode
V  visual (line) mode

:u undo
:q quit
:q! force quit
:wq write, quit
: / <string>  Search for next occurrence of <string>
: ? <string> Search for previous occurrence of <string>
: %  s/<str_a>/<str_b>/g Replace all str_a with str_b in current buffer