Vi cheatsheet

Movement in normal mode

0,$,b,w
start of line, end of line, back a word, forward a word

Find/Replace

:%s/foo/bar/g
replace all 'foo' with 'bar', no confirmation

Folds

zf, zd, zo, zc
create, delete, open, close fold

Misc.

Use `\' to escape special characters

Use xp to switch order of characters


Last updated: 6 November, 2009