Vim Cheatsheet
Essential Vim commands and shortcuts.
Global
:help <keyword>Open help for keyword
:wSave (write) the file
:qQuit
:q!Quit without saving
:wqSave and quit
Cursor Movement
hMove left
jMove down
kMove up
lMove right
wJump forwards to the start of a word
bJump backwards to the start of a word
0Jump to the start of the line
$Jump to the end of the line
ggGo to the first line of the document
GGo to the last line of the document
Insert Mode
iInsert before the cursor
IInsert at the beginning of the line
aInsert (append) after the cursor
AInsert (append) at the end of the line
oAppend a new line below and insert
OAppend a new line above and insert
EscExit insert mode
Editing
rReplace a single character
uUndo
Ctrl + rRedo
xDelete character under cursor
ddDelete (cut) a line
dwDelete (cut) a word
yyYank (copy) a line
pPut (paste) the clipboard after cursor
PPut (paste) before cursor
Search and Replace
/patternSearch for pattern
nRepeat search in same direction
NRepeat search in opposite direction
:%s/old/new/gReplace all old with new throughout file
:%s/old/new/gcReplace all old with new with confirmations
Visual Mode
vStart visual mode, highlight characters
VStart linewise visual mode
Ctrl + vStart visual block mode
>Shift text right
<Shift text left
yYank (copy) marked text
dDelete (cut) marked text
What is Vim?
Vim is a highly configurable, terminal-based text editor built to enable efficient text editing through keyboard shortcuts.
This cheatsheet helps developers master Vim's modal editing system, covering essential commands for navigation, insertion, and manipulation.