Vim

2025.12.12

Mode Switching

KeyDescription
iInsert mode (before cursor)
aInsert mode (after cursor)
oInsert new line below
OInsert new line above
EscReturn to normal mode
vVisual mode
VLine visual mode
:Command mode
KeyDescription
hMove left
jMove down
kMove up
lMove right
wNext word
bPrevious word
0Beginning of line
$End of line
ggBeginning of file
GEnd of file
:<n>Go to line n

Editing

KeyDescription
xDelete character
ddDelete line
yyCopy line
pPaste below
PPaste above
uUndo
Ctrl+rRedo
r<char>Replace character
cwChange word
ciwChange entire word

Search & Replace

KeyDescription
/<pattern>Search forward
?<pattern>Search backward
nNext search result
NPrevious search result
:%s/old/new/gReplace all
:%s/old/new/gcReplace all with confirmation

Save & Exit

KeyDescription
:wSave
:qQuit
:wqSave and quit
:q!Quit without saving
ZZSave and quit (same as :wq)
← Back to list