← Blogs

Vim - Cheatsheet

Vim is a very powerful text editor and can be configured to use as IDE.

Learning vim has a steep learning curve. Try replacing your regular IDE with vim or work with it side by side. Slowly you can figure out how to do basic actions you do in IDE with vim such as copy, paste, select, tab, split and more.

Create your own cheat sheet & that would be the go-to place to reference it later.

I've shared mine below with the vim configuration link.

:qQuit:q!Force quit
:wSave:wqSave & Quit
hMove arrow leftjMove arrow down
kMove arrow uplMove arrow right
Ctrl + rRedo changesuUndo changes
vEnter visual modeVEnter visual line mode
Ctrl + vEnter visual block modedDelete
cYankpPaste
iInsertIPrepend
oNext lineOPrevious line
aAppendAAppend from end of line
ddDelete the whole lineyyCopy full line
yiwCopy current wordccDelete the line & change
rReplace the wordwJump words forward
bJump words backworddwDelete a word
d5wDelete 5 words5d5w5 times delete 5 words
0Start of line$End of line
d0Delete words before the cursord$Delete words after the cursor
ciwDelete word & Insert modecipChange inner paragraph
dipDelete inner paragraphyipYank inner paragraph
vipSelect paragraph%Nearest/matching {[()]}
ggJump to start of fileGJump to end of file
:nGo to line nnGGo to line n
gg=GTo indent allggVG=To indent all in Visual mode
== To indent current line/<word>Search word & Press n to find the next occurrence or N to find the previous occurrence.
maMark the position as admaTo delete mark a
'aJump to mark a']Cycle through mark
'[Cycle through mark in reverse:marksList all marks
zfFold selected linezdDelete fold
zaToggle foldzoOpen fold
zcClose foldzf1jFold one line below
zMClose all foldzRReveal all fold