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:
iI
Enter Insert mode at the beginning of the line
Example:
Ia
Enter Insert mode after the cursor
Example:
aA
Enter Insert mode at the end of the line
Example:
Ao
Open a new line below and enter Insert mode
Example:
oO
Open a new line above and enter Insert mode
Example:
Ov
Enter Visual mode (character selection)
Example:
vV
Enter Visual Line mode (line selection)
Example:
VCtrl+v
Enter Visual Block mode (column selection)
Example:
Ctrl+v:
Enter Command-line mode
Example:
:wEsc
Return to Normal mode from any mode
Example:
EscR
Enter Replace mode (overwrite characters)
Example:
Rh
Move cursor left
Example:
5hj
Move cursor down
Example:
10jk
Move cursor up
Example:
10kl
Move cursor right
Example:
5lw
Move to the start of the next word
Example:
3wb
Move to the start of the previous word
Example:
3be
Move to the end of the current word
Example:
2e0
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:
ggG
Move to the last line of the file
Example:
G:N
Jump to line number N
Example:
:42Ctrl+f
Scroll forward (down) one screen
Example:
Ctrl+fCtrl+b
Scroll backward (up) one screen
Example:
Ctrl+bCtrl+d
Scroll down half a screen
Example:
Ctrl+dCtrl+u
Scroll up half a screen
Example:
Ctrl+uH
Move cursor to the top of the screen
Example:
HM
Move cursor to the middle of the screen
Example:
ML
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:
xdd
Delete (cut) the current line
Example:
dddw
Delete from cursor to the end of the word
Example:
dwd$
Delete from cursor to the end of the line
Example:
d$D
Delete from cursor to end of line (same as d$)
Example:
Dyy
Yank (copy) the current line
Example:
yyyw
Yank (copy) from cursor to end of word
Example:
ywp
Paste after the cursor
Example:
pP
Paste before the cursor
Example:
Pu
Undo the last change
Example:
uCtrl+r
Redo the last undone change
Example:
Ctrl+rcc
Change (delete and enter insert mode) the current line
Example:
cccw
Change from cursor to end of word
Example:
cwc$
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:
?foon
Repeat the last search in the same direction
Example:
nN
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.txtCtrl+w+w
Switch focus to the next split window
Example:
Ctrl+w wCtrl+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:
:tabclosegt
Go to the next tab
Example:
gtgT
Go to the previous tab
Example:
gTq{a-z}
Start recording a macro into register {a-z}
Example:
qqq (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:
:regv then d
Select text in Visual mode then delete it
Example:
vwdv then y
Select text in Visual mode then yank (copy) it
Example:
vwyv then c
Select text in Visual mode then change it
Example:
vwcv then >
Indent selected text to the right
Example:
vip>vip
Select the current paragraph in Visual mode
Example:
vipviw
Select the current word in Visual mode
Example:
viwvis
Select the current sentence in Visual mode
Example:
visV 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 :wm{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 hlsearchga
Show the ASCII value of the character under the cursor
Example:
gazz
Center the current line on the screen
Example:
zzCtrl+g
Show the current file name and cursor position
Example:
Ctrl+gRelated Tools
View all toolsGit Commands Cheat Sheet
Comprehensive Git command cheat sheet. Search 80+ essential Git commands with examples, descriptions, and one-click copy.
Docker Commands Cheat Sheet
Comprehensive Docker command cheat sheet. Search 70+ essential Docker commands with examples, descriptions, and one-click copy.
Linux / Bash Command Cheat Sheet
Comprehensive Linux and Bash command cheat sheet. Search 80+ essential commands with examples, descriptions, and one-click copy.
SQL Query Formatter & Highlighter
Format, beautify, and syntax-highlight SQL queries instantly in your browser. Free, secure, and no upload required.