Vim

Vim Keyboard Shortcuts

Complete Vim keyboard shortcuts. Normal, insert, and visual mode shortcuts and commands.

57
Shortcuts
6
Categories
Free
100% Free

Vim is not a set of shortcuts so much as a small language: an operator like delete, a count, and a motion combine into commands you have never typed before but that work the first time. The rows below are the vocabulary; the notes explain the grammar that makes them multiply. Everything here is Vim's default behaviour and also holds in Neovim and in the Vim modes of VS Code, JetBrains and Obsidian.

Mode Switching 10

i
Insert Mode
Enter insert mode before cursor
a
Append Mode
Enter insert mode after cursor
I
Insert at Line Start
Insert at beginning of line
A
Append at Line End
Insert at end of line
o
Open Line Below
Open new line below and enter insert mode
O
Open Line Above
Open new line above and enter insert mode
Esc
Normal Mode
Return to normal mode
v
Visual Mode
Enter visual mode
V
Visual Line Mode
Enter visual line mode
Ctrl+v
Visual Block Mode
Enter visual block mode

Movement 14

h
Left
Move cursor left
j
Down
Move cursor down
k
Up
Move cursor up
l
Right
Move cursor right
w
Next Word
Jump to start of next word
b
Previous Word
Jump to start of previous word
e
End of Word
Jump to end of word
0
Line Start
Move to start of line
^
First Non-blank
Move to first non-blank character
$
Line End
Move to end of line
gg
File Start
Go to first line
G
File End
Go to last line
Ctrl+f
Page Down
Scroll page down
Ctrl+b
Page Up
Scroll page up

Editing 13

x
Delete Char
Delete character under cursor
dd
Delete Line
Delete current line
dw
Delete Word
Delete word
D
Delete to End
Delete from cursor to end of line
yy
Yank Line
Copy current line
yw
Yank Word
Copy word
p
Paste After
Paste after cursor
P
Paste Before
Paste before cursor
u
Undo
Undo last change
Ctrl+r
Redo
Redo change
r
Replace Char
Replace single character
R
Replace Mode
Enter replace mode
J
Join Lines
Join current line with next

Search 6

/
Search Forward
Search forward
?
Search Backward
Search backward
n
Next Match
Go to next search match
N
Previous Match
Go to previous search match
*
Search Word
Search for word under cursor
#
Search Word Backward
Search word backward

File Operations 7

:w
Save
Save file
:q
Quit
Quit Vim
:wq
Save & Quit
Save and quit
:q!
Force Quit
Quit without saving
:e filename
Edit File
Open file for editing
:sp
Split Horizontal
Split window horizontally
:vsp
Split Vertical
Split window vertically

Advanced 7

.
Repeat
Repeat last command
~
Toggle Case
Toggle case of character
ci"
Change in Quotes
Change text inside quotes
di"
Delete in Quotes
Delete text inside quotes
qa
Record Macro
Record macro to register a
q
Stop Recording
Stop recording macro
@a
Run Macro
Execute macro from register a
📜 Source: Vim documentation — index of all commands (vimhelp.org). Default Vim bindings from the built-in help, which Neovim inherits. Rendered from the same :help text that ships with the editor. Checked 2026-09-04. How we verify ›
📄 View Printable Cheat Sheet — Download as PDF or print

Operators, motions and counts

dd deletes a line and dw deletes a word because d is an operator and w is a motion; the same operator with $ deletes to the end of the line, which is exactly what D is a shortcut for. Any motion in the Movement group can follow d, y (yank) or c (change), and a number in front repeats: 3dw deletes three words, 5j moves down five lines. Once this clicks, the table stops being a list to memorise and becomes a few operators times a few motions.

Text objects are the part worth learning early

ci" changes the text inside the nearest pair of double quotes and di" deletes it, from anywhere on the line — you do not need to be inside the quotes first. The same pattern works with parentheses, brackets, braces and tags, and with a instead of i to include the delimiters. This is the feature that makes Vim editing feel faster than a mouse: "change the argument in these parentheses" is three keystrokes regardless of where the cursor is.

The dot command and macros

. repeats the last change, including an insert, so the workflow for a repeated edit is: make the change once, move to the next place with n or a motion, press dot. For anything longer, qa starts recording a macro into register a, q stops, and @a replays it; a count in front replays it that many times. u undoes and Ctrl + r redoes — note that Ctrl + r inside insert mode is a different command that pastes a register.

Getting out, and the modes that confuse beginners

:wq saves and quits, :q! quits and discards changes, and Esc returns to Normal mode from anywhere; if the editor seems to ignore you, press Esc first. v, V and Ctrl + v start character, line and block visual selections, and block mode plus an insert is how you prepend text to many lines at once. R enters Replace mode, which overwrites rather than inserts and is the usual cause of "my text is disappearing as I type".

Frequently asked questions

How do I exit Vim?

Press Esc to make sure you are in Normal mode, then type :wq and Enter to save and quit, or :q! to quit without saving.

What is the difference between dw and D?

dw deletes from the cursor to the start of the next word. D deletes from the cursor to the end of the line and is shorthand for d$.

Do these commands work in Neovim and VS Code's Vim extension?

Yes. Neovim keeps Vim's default bindings, and the VS Code, JetBrains and Obsidian Vim modes implement the operators, motions and text objects shown here.

Why is my text being overwritten as I type?

You are in Replace mode, entered with R. Press Esc, then i or a to insert normally.

How do I repeat an edit on many lines?

Make the change once, then use . to repeat it after each motion. For multi-step edits record a macro with qa … q and replay it with @a, optionally with a count.

No shortcuts found
Copied!
🔧 Spotted an error or a missing shortcut? Suggest an edit on GitHub — every accepted fix goes live on this page, the API and the CLI.

🤖 Ask AI about Vim shortcuts

Open your assistant with this page preloaded as the source — great for follow-up questions like "which of these work in other apps?"

ChatGPT Claude Perplexity Gemini Grok