Vim Cheatsheet
This cheatsheet provides a comprehensive and practical reference for Vim commands, modes, and operations. Use it to quickly look up and learn essential Vim commands.
Use the search bar to quickly find specific commands or browse through categories for a complete reference.
Basic Movement
h, j, k, l
Mode: Normal
Move left, down, up, right
Move left, down, up, right
Basic cursor movement
w
Mode: Normal
Move to start of next word
Move to start of next word
b
Mode: Normal
Move to start of previous word
Move to start of previous word
e
Mode: Normal
Move to end of word
Move to end of word
0
Mode: Normal
Move to start of line
Move to start of line
$
Mode: Normal
Move to end of line
Move to end of line
gg
Mode: Normal
Move to start of file
Move to start of file
G
Mode: Normal
Move to end of file
Move to end of file
Ctrl + f
Mode: Normal
Move forward one page
Move forward one page
Ctrl + b
Mode: Normal
Move backward one page
Move backward one page
Insert Mode
i
Mode: Normal
Insert before cursor
Insert before cursor
a
Mode: Normal
Insert after cursor
Insert after cursor
I
Mode: Normal
Insert at start of line
Insert at start of line
A
Mode: Normal
Insert at end of line
Insert at end of line
o
Mode: Normal
Insert new line below
Insert new line below
O
Mode: Normal
Insert new line above
Insert new line above
Esc
Mode: Insert
Exit insert mode
Exit insert mode
Editing
dd
Mode: Normal
Delete line
Delete line
yy
Mode: Normal
Copy line
Copy line
p
Mode: Normal
Paste after cursor
Paste after cursor
P
Mode: Normal
Paste before cursor
Paste before cursor
x
Mode: Normal
Delete character under cursor
Delete character under cursor
r
Mode: Normal
Replace character under cursor
Replace character under cursor
u
Mode: Normal
Undo last change
Undo last change
Ctrl + r
Mode: Normal
Redo last undone change
Redo last undone change
cw
Mode: Normal
Change word
Change word
cc
Mode: Normal
Change line
Change line
Search & Replace
/pattern
Mode: Normal
Search forward for pattern
Search forward for pattern
?pattern
Mode: Normal
Search backward for pattern
Search backward for pattern
n
Mode: Normal
Find next match
Find next match
N
Mode: Normal
Find previous match
Find previous match
:%s/old/new/g
Mode: Command
Replace all occurrences
Replace all occurrences
:%s/old/new/gc
Mode: Command
Replace with confirmation
Replace with confirmation
*
Mode: Normal
Search for word under cursor
Search for word under cursor
Visual Mode
v
Mode: Normal
Enter visual mode
Enter visual mode
V
Mode: Normal
Enter line visual mode
Enter line visual mode
Ctrl + v
Mode: Normal
Enter block visual mode
Enter block visual mode
y
Mode: Visual
Yank (copy) selected text
Yank (copy) selected text
d
Mode: Visual
Delete selected text
Delete selected text
c
Mode: Visual
Change selected text
Change selected text
>
Mode: Visual
Indent right
Indent right
<
Mode: Visual
Indent left
Indent left
File Operations
:w
Mode: Command
Save file
Save file
:q
Mode: Command
Quit
Quit
:wq
Mode: Command
Save and quit
Save and quit
:q!
Mode: Command
Quit without saving
Quit without saving
:e filename
Mode: Command
Edit file
Edit file
:sp filename
Mode: Command
Split window and edit file
Split window and edit file
:vsp filename
Mode: Command
Vertical split and edit file
Vertical split and edit file
Advanced
ma
Mode: Normal
Set mark 'a' at cursor position
Set mark 'a' at cursor position
'a
Mode: Normal
Jump to mark 'a'
Jump to mark 'a'
Ctrl + w
Mode: Normal
Window commands prefix
Window commands prefix
Ctrl + w + h/j/k/l
Mode: Normal
Move to window left/down/up/right
Move to window left/down/up/right
Ctrl + w + s
Mode: Normal
Split window horizontally
Split window horizontally
Ctrl + w + v
Mode: Normal
Split window vertically
Split window vertically
Ctrl + w + c
Mode: Normal
Close current window
Close current window
Ctrl + w + o
Mode: Normal
Close all other windows
Close all other windows
gf
Mode: Normal
Open file under cursor
Open file under cursor
Ctrl + ]
Mode: Normal
Jump to definition
Jump to definition
Categories
- Basic Movement
Essential cursor movement commands for navigation.
- Insert Mode
Commands for entering and exiting insert mode.
- Editing
Text manipulation, deletion, and modification commands.
- Search & Replace
Pattern searching and text replacement operations.
- Visual Mode
Text selection and manipulation in visual mode.
- File Operations
File saving, loading, and window management.
- Advanced
Advanced features like marks, windows, and navigation.
Features
- Quick search functionality
- Organized by categories
- Mode-specific commands
- Common and advanced operations
- Clear command descriptions
- Responsive design
- Perfect for quick reference