Skip to content

Vim Cheat Sheet

Last verified May 2026 — runs in your browser
Vim Cheatsheet
Esc

Return to normal mode

Modes
i

Insert before cursor

Modes
a

Insert after cursor (append)

Modes
I

Insert at beginning of line

Modes
A

Insert at end of line

Modes
o

Open new line below and insert

Modes
O

Open new line above and insert

Modes
v

Visual mode (character-wise)

Modes
V

Visual mode (line-wise)

Modes
Ctrl+v

Visual block mode (columns)

Modes
h j k l

Left, down, up, right

Movement
w

Next word start

Movement
b

Previous word start

Movement
e

End of current word

Movement
0

Start of line

Movement
^

First non-blank of line

Movement
$

End of line

Movement
gg

Top of file

Movement
G

Bottom of file

Movement
:42

Jump to line 42

Movement
42G

Jump to line 42 (alt)

Movement
Ctrl+d

Half page down

Movement
Ctrl+u

Half page up

Movement
Ctrl+f

Page down (forward)

Movement
Ctrl+b

Page up (back)

Movement
%

Matching bracket/paren

Movement
{  }

Previous/next paragraph

Movement
x

Delete character under cursor

Editing
X

Delete character before cursor

Editing
dd

Delete (cut) line

Editing
dw

Delete word

Editing
d$

Delete to end of line

Editing
D

Delete to end of line (alt)

Editing
yy

Yank (copy) line

Editing
yw

Yank word

Editing
p

Paste after cursor

Editing
P

Paste before cursor

Editing
u

Undo

Editing
Ctrl+r

Redo

Editing
r<char>

Replace single character

Editing
R

Replace mode (overtype)

Editing
cw

Change word (delete + insert)

Editing
cc

Change line

Editing
.

Repeat last change

Editing
>> <<

Indent / outdent line

Editing
J

Join line below with current

Editing
/pattern

Search forward

Search & Replace
?pattern

Search backward

Search & Replace
n

Next match

Search & Replace
N

Previous match

Search & Replace
*

Search word under cursor

Search & Replace
:%s/old/new/g

Replace all in file

Search & Replace
:%s/old/new/gc

Replace with confirmation

Search & Replace
:s/old/new/g

Replace on current line

Search & Replace
:noh

Clear search highlight

Search & Replace
:w

Save file

Files & Buffers
:w filename

Save as

Files & Buffers
:q

Quit

Files & Buffers
:q!

Quit without saving

Files & Buffers
:wq or ZZ

Save and quit

Files & Buffers
:e filename

Open file

Files & Buffers
:bn :bp

Next / previous buffer

Files & Buffers
:ls

List open buffers

Files & Buffers
:bd

Close current buffer

Files & Buffers
:split :vsplit

Horizontal / vertical split

Files & Buffers
Ctrl+w w

Switch between splits

Files & Buffers
Ctrl+w q

Close current split

Files & Buffers
Showing 67 of 67 commands

Vim Cheat Sheet — Modes, Motions, Commands & Keyboard Shortcuts Reference

A searchable Vim quick reference covering modes (normal/insert/visual), movement, editing, search and replace, file operations, buffers, and splits.

About this cheatsheet

A comprehensive Vim cheatsheet organized by workflow: modes, movement, editing, search, and file management.

  • 65+ Vim commands and shortcuts
  • Modes: normal, insert, visual, block
  • Movement: words, lines, pages, marks
  • Editing: delete, yank, paste, change
  • Search and replace with ranges
  • Buffers, splits, and file ops

Free. No signup. Your inputs stay in your browser. Ads via Google AdSense (consent required).

By ·