Vim Cheatsheet
Power user.
Mode basics
Normal mode (Esc): commands, navigation, deletions.
Insert mode (i, a, o): editing text. Esc returns to normal.
Visual mode (v, V, Ctrl-v): selection. Linewise (V), characterwise (v), blockwise (Ctrl-v).
Navigation
h/j/k/l: left/down/up/right. Faster with prefix counts: 5j moves down 5 lines.
w/b/e: word forward, back, end. W/B/E: WORD (whitespace-separated).
gg/G: top/bottom of file. {/}: previous/next paragraph. Ctrl-d/Ctrl-u: half-page down/up.
Editing
dd: delete line. yy: yank (copy) line. p/P: paste after/before.
ciw: change inner word. ci": change inside double-quotes. d3w: delete 3 words.
u: undo. Ctrl-r: redo. .: repeat last change.
Search and replace
/pattern: search forward. ?pattern: backward. n/N: next/previous match.
:%s/old/new/g: replace globally in file. :%s/old/new/gc: with confirmation.
*/#: search current word forward/back.