My VIM Cheat Sheet

April 21, 2022 (2y ago)

My VIM Cheat Sheet

A Great Vim Cheat Sheet! I have compiled a list of essential Vim commands that I use every day.

BasicsKeys
Move 1 characterh / j / k / l
Move to next worde
Move before next wordw
Jump to beginning of line0 -> w OR ^
Jump to end of line$
Jump to characterf
Jump to character beforet
NavigationKeys
Jump to beginning of next / prev line+ / -
Jump to end of line in edit modeA
Search next / prev/ / ?
Go to beginning / endgg / G
Go up / down half-pageCtrl + u / d
Center to screenzz
Go to next / prev block[ / ]
Go to next / prev block start / end( / )
Go to line [num][num]G
Repeat search forward / backward; / ,
Jump to matching bracket%
Move cursor half-page up / downCtrl + u / d
Jump to upper / middle / bottom of editorU / M / D
Go to definitiongd
Go to filegf
Bookmark to letterm[letter]
Go to bookmark`[letter]
SelectionKeys
Select (visual mode)v
Select lineV
Column selectCtrl + V
Column select and typeCtrl + V - I
Select all occurrencesCtrl + Shift + L
Add to selectiongb
Clear searchCtrl + n
EditingKeys
Edit (insert mode)i
Append (insert mode)a
Copy line up/downyy - p / P
Delete linedd
Insert line belowo
Insert line aboveO
Delete characterx
Delete prev characterX
Replace characterr
Replace modeR
Comment selectionCtrl + / OR gc
Change case~
Repeat command.
Merge with next lineJ
SurroundS
MotionKeys
Select wordviw
Change wordciw
Change blockcip
Delete to the next worddw
Delete tilldt…
Change tillct…
Change inner () / [] / {}ci + ( / [ / {
Change inner tagcit
Change surrounding (‘ -> “)cs ’ ”
Surround lineys + [surround]
Surround wordys + iw + [surround]
Delete surroundds + [surround]