Free Converter

Vim Commands Cheat Sheet

Comprehensive Vim command cheat sheet. Search 80+ essential Vim commands with examples, descriptions, and one-click copy.

i
Enter Insert mode before the cursor
Example:i
I
Enter Insert mode at the beginning of the line
Example:I
a
Enter Insert mode after the cursor
Example:a
A
Enter Insert mode at the end of the line
Example:A
o
Open a new line below and enter Insert mode
Example:o
O
Open a new line above and enter Insert mode
Example:O
v
Enter Visual mode (character selection)
Example:v
V
Enter Visual Line mode (line selection)
Example:V
Ctrl+v
Enter Visual Block mode (column selection)
Example:Ctrl+v
:
Enter Command-line mode
Example::w
Esc
Return to Normal mode from any mode
Example:Esc
R
Enter Replace mode (overwrite characters)
Example:R
h
Move cursor left
Example:5h
j
Move cursor down
Example:10j
k
Move cursor up
Example:10k
l
Move cursor right
Example:5l
w
Move to the start of the next word
Example:3w
b
Move to the start of the previous word
Example:3b
e
Move to the end of the current word
Example:2e
0
Move to the beginning of the line
Example:0
^
Move to the first non-blank character of the line
Example:^
$
Move to the end of the line
Example:$
gg
Move to the first line of the file
Example:gg
G
Move to the last line of the file
Example:G
:N
Jump to line number N
Example::42
Ctrl+f
Scroll forward (down) one screen
Example:Ctrl+f
Ctrl+b
Scroll backward (up) one screen
Example:Ctrl+b
Ctrl+d
Scroll down half a screen
Example:Ctrl+d
Ctrl+u
Scroll up half a screen
Example:Ctrl+u
H
Move cursor to the top of the screen
Example:H
M
Move cursor to the middle of the screen
Example:M
L
Move cursor to the bottom of the screen
Example:L
%
Jump to matching bracket, parenthesis, or brace
Example:%
x
Delete the character under the cursor
Example:x
dd
Delete (cut) the current line
Example:dd
dw
Delete from cursor to the end of the word
Example:dw
d$
Delete from cursor to the end of the line
Example:d$
D
Delete from cursor to end of line (same as d$)
Example:D
yy
Yank (copy) the current line
Example:yy
yw
Yank (copy) from cursor to end of word
Example:yw
p
Paste after the cursor
Example:p
P
Paste before the cursor
Example:P
u
Undo the last change
Example:u
Ctrl+r
Redo the last undone change
Example:Ctrl+r
cc
Change (delete and enter insert mode) the current line
Example:cc
cw
Change from cursor to end of word
Example:cw
c$
Change from cursor to end of line
Example:c$
.
Repeat the last change
Example:.
>>
Indent the current line one level to the right
Example:>>
<<
Unindent the current line one level to the left
Example:<<
==
Auto-indent the current line
Example:==
J
Join the current line with the line below
Example:J
~
Toggle case of character under cursor
Example:~
r{char}
Replace the character under the cursor with {char}
Example:ra
/{pattern}
Search forward for pattern
Example:/foo
?{pattern}
Search backward for pattern
Example:?foo
n
Repeat the last search in the same direction
Example:n
N
Repeat the last search in the opposite direction
Example:N
*
Search forward for the word under the cursor
Example:*
#
Search backward for the word under the cursor
Example:#
:s/old/new/g
Replace all occurrences of old with new on the current line
Example::s/foo/bar/g
:%s/old/new/g
Replace all occurrences of old with new in the whole file
Example::%s/foo/bar/g
:%s/old/new/gc
Replace all with confirmation prompts
Example::%s/foo/bar/gc
:noh
Clear the search highlight
Example::noh
:w
Save the current file
Example::w
:w filename
Save the current buffer as a new filename
Example::w newfile.txt
:q
Quit (close the window)
Example::q
:wq
Save and quit
Example::wq
:q!
Quit without saving (force quit)
Example::q!
:x
Save and quit (only writes if changes were made)
Example::x
:e filename
Open a file for editing
Example::e README.md
:sp
Split the window horizontally
Example::sp file.txt
:vsp
Split the window vertically
Example::vsp file.txt
Ctrl+w+w
Switch focus to the next split window
Example:Ctrl+w w
Ctrl+w+h/j/k/l
Move focus to the window in the given direction
Example:Ctrl+w l
:close
Close the current window split
Example::close
:only
Close all windows except the current one
Example::only
:bn
Switch to the next buffer
Example::bn
:bp
Switch to the previous buffer
Example::bp
:bd
Delete (close) the current buffer
Example::bd
:ls
List all open buffers
Example::ls
:b N
Switch to buffer number N
Example::b 2
:tabnew
Open a new tab
Example::tabnew file.txt
:tabn
Switch to the next tab
Example::tabn
:tabp
Switch to the previous tab
Example::tabp
:tabclose
Close the current tab
Example::tabclose
gt
Go to the next tab
Example:gt
gT
Go to the previous tab
Example:gT
q{a-z}
Start recording a macro into register {a-z}
Example:qq
q (stop)
Stop recording the current macro
Example:q
@{a-z}
Execute the macro stored in register {a-z}
Example:@q
@@
Repeat the last executed macro
Example:@@
N@{a-z}
Execute macro N times
Example:5@q
:reg
Show the contents of all registers
Example::reg
v then d
Select text in Visual mode then delete it
Example:vwd
v then y
Select text in Visual mode then yank (copy) it
Example:vwy
v then c
Select text in Visual mode then change it
Example:vwc
v then >
Indent selected text to the right
Example:vip>
vip
Select the current paragraph in Visual mode
Example:vip
viw
Select the current word in Visual mode
Example:viw
vis
Select the current sentence in Visual mode
Example:vis
V then J
Select lines in Visual Line mode then join them
Example:VjJ
:set number
Show line numbers
Example::set number
:set nonumber
Hide line numbers
Example::set nonumber
:syntax on
Enable syntax highlighting
Example::syntax on
:colorscheme
Change the color scheme
Example::colorscheme desert
:help {topic}
Open Vim help for a topic
Example::help :w
m{a-z}
Set a mark at the current cursor position
Example:ma
'{a-z}
Jump to the line of a mark
Example:'a
`{a-z}
Jump to the exact position of a mark
Example:`a
:set paste
Enable paste mode to avoid auto-indent issues
Example::set paste
:set ignorecase
Make searches case-insensitive
Example::set ignorecase
:set hlsearch
Highlight all search matches
Example::set hlsearch
ga
Show the ASCII value of the character under the cursor
Example:ga
zz
Center the current line on the screen
Example:zz
Ctrl+g
Show the current file name and cursor position
Example:Ctrl+g

About This Tool

A comprehensive quick-reference guide for vim commands. Browse commonly used commands, syntax, and examples organized by category. Searchable and mobile-friendly — bookmark this page for instant access when you need a quick reminder.

How to Use

  1. Browse the categorized reference sections.
  2. Use the search bar to find specific commands or syntax.
  3. Click on any entry to see usage examples and explanations.
  4. Copy commands directly for use in your terminal or editor.

Frequently Asked Questions

Is this reference up to date?
The reference covers widely-used commands and syntax that are stable across versions. For the latest additions or version-specific features, check the official documentation.
Can I use this offline?
Once loaded, the page works without an internet connection. Bookmark it for quick access — all content is rendered in the browser without further network requests.
Is this comprehensive or just the basics?
It covers the most commonly used commands and patterns that handle 90% of everyday tasks. For niche or advanced features, consult the official documentation.
Can I suggest additions?
We regularly update our references. If you notice missing commands or have suggestions, let us know through our contact page.