Vim Cheat Sheet


Up: K or Up Arrow
Left: H or Left Arrow Right: L or Left Arrow
Down: J or Down Arrow
Go to end of line $
Go to end of Document Shift+G
Go to line # [#]Shift+G


Enter command mode :
Execute external command :! [external command]
Turn on line numbers :set number
Turn off line numbers :set number!
Quit, do not save :q!
Quit and save :wq
Show current pathname, line and percent CTRL+G
Search for [Search Phrase] :/[Search Phrase]
Search for [Search Phrase] reverse :?[Search Phrase]
Repeat search :n
Repeat search reverse :N
Find matching parentheses, braces, or brackets :%


Insert text @ cursor i
Insert text after cursor a
Overstrike R
Insert line o
Insert line @ cursor O
Delete under cursor x
Delete to end of word (include spaces) dw
Delete to end of word (do not include spaces) de
Delete to end of line d$
Delete line d
Delete to end of file dG
Place previously deleted test at cursor (Put) p
Overstrike single character (Replace) r
Change to end of word cw
Change to end of line c$
Undo previous change u
Undo all line changes U
Replace "old text" with "new text" once :s/old text/new text/
Replace "old text" with "new text" to end of file :s/old text/new text/g
Replace "old text" with "new text" globaly :%s/old text/new text/g
Replace "old text" with "new text" from line#1 to line#2 :[line#1],[Line#2] s/old text/new text/g
Save to filename :w [filename]
Insert filename @ cursor :r [filename]
Save from line#1 to line#2 to filename :[line#1],[Line#2] w[filename]

Document Actions