Skip to content
Vim Keyboard Shortcuts Cheatsheet — Printable PDF Reference

Vim Keyboard Shortcuts Cheatsheet — Printable PDF Reference

DodaTech Updated Jun 20, 2026 5 min read

📄 Printable PDF: Use your browser’s Print (Ctrl+P / Cmd+P) → “Save as PDF” to get a printer-friendly PDF of this Vim shortcut cheatsheet.

Complete Vim keyboard shortcuts reference for efficient text editing without touching the mouse. Covers normal mode, insert mode, visual mode, buffers, windows, marks, registers, and ex commands.

Basic Navigation (Normal Mode)

ShortcutWhat it does
h / j / k / lLeft / Down / Up / Right
w / bNext word / Back word
W / BNext WORD / Back WORD
e / geEnd of word / End of prev word
0 / $Start of line / End of line
^First non-blank character
gg / GFirst line / Last line
:42 or 42GGo to line 42
Ctrl+d / Ctrl+uPage down / Page up (half)
Ctrl+f / Ctrl+bPage down / Page up (full)
H / M / LTop / Middle / Bottom of screen
%Matching bracket
{ / }Previous / Next paragraph
( / )Previous / Next sentence
zzCenter screen on cursor
zt / zbCursor to top / bottom of screen

Insert Mode

ShortcutWhat it does
iInsert before cursor
IInsert at start of line
aAppend after cursor
AAppend at end of line
oOpen new line below
OOpen new line above
sDelete char and insert
SDelete line and insert
giResume last insert position
Esc / Ctrl+[Return to normal mode
Ctrl+hDelete char before cursor (backspace)
Ctrl+wDelete word before cursor
Ctrl+uDelete to start of line
Ctrl+r {reg}Insert from register

Visual Mode

ShortcutWhat it does
vStart character-wise visual
VStart line-wise visual
Ctrl+vStart block-wise visual
gvReselect previous visual
oMove to other end of selection
aw / iwSelect a word / inner word
a( / i(Select around / inside parens
a{ / i{Select around / inside braces
a[ / i[Select around / inside brackets
a" / i"Select around / inside quotes
> / <Indent / outdent selection
~ / u / UToggle / lowercase / uppercase
d / yDelete / yank (copy) selection

Editing & Yank/Paste

ShortcutWhat it does
xDelete character under cursor
XDelete character before cursor
ddDelete line
dw / dawDelete word / a word
d$ / d0Delete to end / start of line
diw / dawDelete inner word / a word
yyYank (copy) line
YYank to end of line
yw / y$Yank word / to end of line
p / PPaste after / before cursor
gp / gPPaste and move cursor after
u / Ctrl+rUndo / Redo
.Repeat last change
JJoin lines
r{x}Replace char under cursor
REnter replace mode
ccChange (replace) whole line
CChange to end of line
c$Change to end of line
ciw / ci(Change inner word / inside parens

Search & Replace

ShortcutWhat it does
/patternSearch forward
?patternSearch backward
n / NNext match / Previous match
* / #Search word under cursor forward / backward
:%s/old/new/gReplace all in file
:%s/old/new/gcReplace all with confirm
:5,10s/old/new/gReplace in lines 5–10
:nohClear search highlight

Windows & Tabs

ShortcutWhat it does
:sp [file]Split window horizontally
:vs [file]Split window vertically
Ctrl+w sHorizontal split
Ctrl+w vVertical split
Ctrl+w wCycle windows
Ctrl+w h/j/k/lNavigate windows
Ctrl+w H/J/K/LMove window to far left/down/up/right
Ctrl+w =Equal size windows
Ctrl+w _ / `Ctrl+w`
:q or Ctrl+w qClose window
:tabnewNew tab
gt / gTNext tab / Previous tab
{n}gtGo to tab n
:tabcloseClose tab

Buffers

ShortcutWhat it does
:e fileEdit file (open in buffer)
:bnext or :bnNext buffer
:bprev or :bpPrevious buffer
:bfirst / :blastFirst / last buffer
:bdDelete (close) buffer
:lsList all buffers
:b {n}Go to buffer n
Ctrl+^Toggle to alternate buffer
:bdeleteDelete buffer
:bufdoCommand on all buffers

Marks & Registers

ShortcutWhat it does
m{a-z}Set local mark
m{A-Z}Set global mark (across files)
'{a-z}Jump to line of mark
`{a-z}Jump to exact position of mark
:marksList all marks
"{reg}yYank into specific register
"{reg}pPaste from specific register
"0 / "1Yank register / delete register
"+yYank to system clipboard
"+pPaste from system clipboard
:regList all registers
qq / qStart / stop recording macro to q
@qPlay macro from register q

Ex Commands

CommandWhat it does
:wSave file
:qQuit
:wq or :xSave and quit
:q!Force quit (discard changes)
:w!Force write (overwrite read-only)
:e!Reload file (discard changes)
:set numberShow line numbers
:set nonumberHide line numbers
:set relativenumberRelative line numbers
:set hlsearchHighlight search matches
:set incsearchIncremental search
:set ignorecaseCase-insensitive search
:set smartcaseSmart case search
:set tabstop=4Tab width = 4
:set shiftwidth=4Indent width = 4
:set expandtabTabs → spaces
:colorscheme {name}Change color scheme
:help {topic}Open help for topic
:!{cmd}Run shell command
How do I exit Vim?
Press Esc to ensure you’re in normal mode, then type :q and press Enter. To save and exit, type :wq or :x. To force quit without saving, type :q!. If you see E37: No write since last change, use :q! to discard changes or :wq to save them.
How do I search and replace in Vim?
Use the substitute command: :%s/old/new/g replaces all occurrences of “old” with “new” in the file. Add c at the end (:%s/old/new/gc) for confirmation on each match. For a line range, use :5,10s/old/new/g to replace only between lines 5 and 10.

See the full Vim guide for advanced configuration and custom key mappings.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro