320 x 50 Mobile Ad
Cheat Sheets

Vim Cheat Sheet

Transform, format, and optimize your data instantly with this free client-side tool.

Modes

i

Insert mode (before cursor)

I

Insert mode (beginning of line)

a

Append mode (after cursor)

A

Append mode (end of line)

o

Open new line below cursor and enter insert mode

O

Open new line above cursor and enter insert mode

v

Visual mode (character selection)

V

Visual line mode (line selection)

<Ctrl> + v

Visual block mode

<Esc>

Exit current mode (return to Normal mode)

Navigation

h

Move left

j

Move down

k

Move up

l

Move right

w

Move forward to beginning of next word

b

Move backward to beginning of previous word

e

Move forward to end of current word

0

Move to beginning of line

^

Move to first non-blank character of line

$

Move to end of line

gg

Move to first line of file

G

Move to last line of file

<line_number>G

Move to a specific line number

Editing

x

Delete character under cursor

r<char>

Replace character under cursor with <char>

dd

Delete (cut) current line

dw

Delete to next word

d$

Delete to end of line

yy

Yank (copy) current line

yw

Yank (copy) word

p

Paste after cursor

P

Paste before cursor

u

Undo last action

<Ctrl> + r

Redo last undone action

Search & Replace

/<pattern>

Search forward for <pattern>

?<pattern>

Search backward for <pattern>

n

Repeat search in same direction

N

Repeat search in opposite direction

:s/old/new/

Replace first occurrence of 'old' with 'new' on current line

:s/old/new/g

Replace all occurrences of 'old' with 'new' on current line

:%s/old/new/g

Replace all occurrences of 'old' with 'new' throughout file

:%s/old/new/gc

Replace all occurrences with confirmation

Save & Quit

:w

Write (save) file

:w <filename>

Write to a new file

:q

Quit (fails if there are unsaved changes)

:q!

Quit and discard changes

:wq

Write and quit

:x

Write and quit (same as :wq)

ZZ

Write and quit (shortcut)

Multiple Files

:e <file>

Edit a file in a new buffer

:bnext (or :bn)

Go to next buffer

:bprev (or :bp)

Go to previous buffer

:bd

Delete current buffer (close file)

:sp <file>

Open a file in a new horizontal split

:vsp <file>

Open a file in a new vertical split

<Ctrl> + w + <arrow>

Move between split windows

:tabnew <file>

Open a file in a new tab

gt

Go to next tab

gT

Go to previous tab

Advanced

Advanced Command Snippet

Explore advanced configurations for Vim

System Optimization

Performance tuning best practices for Vim

Security Audit

Run security checks and validation for Vim

320 x 50 Mobile Ad

Frequently Asked Questions

Got questions? We've got answers.

The Vim Cheatsheet is a quick-reference guide that provides developers with the most essential and frequently used Vim commands, syntax, and snippets in one centralized place.
This reference is built for both beginners who are just learning Vim and need a quick syntax lookup, as well as seasoned professionals who need to jog their memory on complex commands.
You can use the real-time search bar at the top of the cheatsheet. Simply type a keyword (like &#39;delete&#39; or &#39;file&#39;) and the list will instantly filter to show only matching Vim commands.
Yes! Every command block features a one-click copy button. Just hover over the command and click the copy icon to instantly send the snippet to your clipboard.
The cheatsheet is divided into logical categories such as Basics, Network, Operations, and specific Vim features. You can click on the category filters at the top to isolate specific groups of commands.
Absolutely. This Vim reference guide is 100% free, requiring no sign-ups or subscriptions, and is always available when you need it.
While these are standard Vim operations, you should always understand what a command does before running it, especially if it involves system operations or destructive actions.
Yes, we have recently expanded this cheatsheet to include advanced snippets, best practices, and edge-case syntax that go beyond basic introductory commands.
ADVERTISEMENT
Boost Your Business Online