Vim Command Reference

h
Move Left
Move cursor one character to the left.
j
Move Down
Move cursor one line down.
k
Move Up
Move cursor one line up.
l
Move Right
Move cursor one character to the right.
w
Next Word Start
Jump to the start of the next word.
W
Next WORD Start
Jump to next blank-separated WORD.
b
Previous Word
Jump back to the start of the current/previous word.
e
End of Word
Jump to the end of the current word.
0
Line Start
Go to the first character of the line.
^
Line First Non-Blank
Jump to first non-space character.
$
Line End
Go to the last character of the line.
gg
<
Go to First Line
Move cursor to the top of the file.
G
Go to Last Line
Move cursor to the end of the file.
:{n}
Go to Line n
Example: :15 → jump to line 15.
Ctrl + u
Scroll Up Half Page
Scroll window up without moving cursor.
Ctrl + d
Scroll Down Half Page
Scroll window down without moving cursor.
i
Insert Before Cursor
Enter insert mode at current position.
I
Insert at Line Start
Insert at first non-blank character.
a
Append After Cursor
Enter insert mode after cursor.
A
Append at Line End
Insert mode at end of line.
o
New Line Below
Create line below and enter insert mode.
O
New Line Above
Create line above and enter insert mode.
Esc
Exit Insert Mode
Return to normal mode.
x
Delete Character
Delete character under cursor.
X
Delete Before Cursor
Delete character left of cursor.
dd
Delete Line
Cut current line.
D
Delete to Line End
Delete from cursor to end of line.
yy
Yank Line
Copy current line.
p
Paste Below
Paste after cursor/line.
P
Paste Above
Paste before cursor/line.
u
Undo
Undo last change.
Ctrl + r
Redo
Redo undone changes.
.
Repeat Last Command
Repeat the last editing action.
v
Visual Mode
Start character selection.
V
Visual Line
Select full lines.
Ctrl + v
Visual Block
Select rectangular block.
y
Yank Selection
Copy selected text.
d
Delete Selection
Cut selected text.
:w
Save File
Write changes to disk.
:wq
Save & Quit
Save and exit Vim.
:q
Quit
Exit if no unsaved changes.
:q!
Force Quit
Exit without saving.
:e file
Open File
Edit another file.
:set number
Show Line Numbers
Display line numbers.
:set nonumber
Hide Line Numbers
Turn off line numbers.
:set relativenumber
Relative Line Numbers
Show distance to other lines.
:split
Split Window Horizontally
Open horizontal split pane.
:vsplit
Split Window Vertically
Open vertical split pane.
Ctrl + ww
Switch Windows
Cycle between split panes.
:set syntax=on
Enable Syntax
Turn on syntax highlighting.