Vim rewards depth over breadth.
You don’t need to know every command—just a small, reliable core that lets you move, edit, and refactor text efficiently without leaving the keyboard.
This cheatsheet focuses on high-value commands that cover the majority of real-world editing tasks.
Vim is modal. Understanding this matters more than memorizing commands.
- Normal mode: navigation and commands
- Insert mode: text entry
- Visual mode: selection
- Command mode: file and editor commands
If Vim feels confusing, it’s usually a mode issue.
Move the cursor:
h j k lWord movement:
w next word
b previous word
e end of wordLine movement:
0 start of line
^ first non-blank character
$ end of lineFile movement:
gg top of file
G bottom of fileEnter insert mode:
i insert before cursor
a insert after cursor
o open new line below
O open new line aboveExit insert mode:
EscReturning to Normal mode quickly is essential.
Delete:
x delete character
dd delete line
dw delete word
d$ delete to end of lineChange:
cw change word
cc change line
c$ change to end of lineUndo and redo:
u undo
Ctrl-r redoYank (copy):
yy yank line
yw yank wordDelete (cut):
ddPaste:
p paste after cursor
P paste before cursorVim treats delete as a form of cut.
Enter visual mode:
v character-wise
V line-wise
Ctrl-v block-wiseAfter selecting:
y yank
d delete
> indent
< unindentVisual mode makes structural edits safer.
Search forward:
/patternSearch backward:
?patternNavigate results:
n next match
N previous matchClear search highlighting:
:nohReplace in the current line:
:s/old/new/Replace globally in file:
:%s/old/new/gConfirm each replacement:
:%s/old/new/gcSearch and replace is one of Vim’s strongest features.
Save file:
:wQuit:
:qSave and quit:
:wqQuit without saving:
:q!Open a file:
:e filenameHorizontal split:
:splitVertical split:
:vsplitMove between splits:
Ctrl-w h
Ctrl-w j
Ctrl-w k
Ctrl-w lClose a split:
:closeSplits work well for side-by-side comparisons.
Repeat last command:
.Indent selection:
>>
<<Auto-indent file:
gg=GRepeatability is where Vim speed comes from.
- Staying in Insert mode too long
- Using arrow keys instead of motions
- Avoiding Normal mode commands
- Trying to memorize everything at once
Vim improves with gradual adoption.
- Learn motions before plugins
- Optimize for editing, not aesthetics
- Use Vim where latency matters (SSH, servers)
- Let muscle memory build slowly
Mastery comes from repetition, not shortcuts.
- Vim is modal by design—embrace it
- A small command set covers most tasks
- Motions + operators unlock power
- Search and replace are first-class tools
- Efficiency comes from staying on the keyboard
You don’t need to know Vim—you need to be comfortable in it.