The 14 Essential Vim Commands
The 14 most essential commands you need for your everyday typing needs are right here!
Bookmark this site for easy reference later, or even use this as a starting point to build your own cheat sheet. And if you're looking for a more detailed introduction to Vim, check out Part 1 of this series!
Note: these commands are used in Normal mode unless otherwise specified.
Move cursor to the left/up/down/right
h/j/k/l
Insert text
i
This puts you into writing mode, inserting the cursor right before its current position.
Visual mode
v
Entering visual mode will allow you to highlight text by moving your cursor.
Yank
y
When in visual mode, copies (aka yanks) the highlighted text into your Vim clipboard
Copy to system clipboard
"+y
When in visual mode, copies the highlighted text into your system clipboard. This means you’ll be able to paste it into other apps on your computer.
Puts
p
Pastes (aka puts) whatever’s in your Vim clipboard in the space after your cursor.
Undo
u
Delete character
x
Deletes the character immediately under the cursor.
Delete word
dw
Deletes the remainder of the word from the current position of the cursor. Note: this will also add the deleted text into the Vim clipboard.
Move cursor to start of next word
w
Move cursor to the start of the previous word
b
Move cursor to the line number <n>
<n>g
Search for the next occurrence of specified <text> in the file
/<text>
When you press <Enter>, the next occurrence of <text> will be highlighted.
Search and replace
:%s/<old text>/<replacement text>/gc
Globally replaces every occurrence of <old text> in the file and replaces it with <replacement text>. The c option also means that the user will be prompted to confirm each change