Hotkeys and shortcuts for Vim (Linux)

(Total 76)

h
Cursor Movement
Move left
j
Cursor Movement
Move down
k
Cursor Movement
Move up
l
Cursor Movement
Move right
w
Cursor Movement
Jump by start of words
W
Cursor Movement
Jump by words
e
Cursor Movement
Jump to end of words
E
Cursor Movement
Jump to end of words (no punctuation)
b
Cursor Movement
Jump backward by words (punctuation considered words)
B
Cursor Movement
Jump backward by words (no punctuation)
0
Cursor Movement
Start of line
^
Cursor Movement
First non-blank character of line
$
Cursor Movement
End of line
G
Cursor Movement
Go To command (prefix with number)
i
Cursor Movement
Start insert mode at cursor
I
Cursor Movement
Insert at the beginning of the line
a
Cursor Movement
Append after the cursor
A
Cursor Movement
Append at the end of the line
o
Cursor Movement
Open (append) blank line below current line (no need to press return)
O
Cursor Movement
Open blank line above current line
ea
Cursor Movement
Append at end word
Esc
Cursor Movement
Exit insert mode
r
Editing
Replace a single character (does not use insert mode)
J
Editing
Join line below to the current one
cc
Editing
Change (replace) an entire line
cw
Editing
Change (replace) to the end of word
c$
Editing
Change (replace) to the end of line
s
Editing
Delete character at cursor and subsitute text
S
Editing
Delete line at cursor and substitute text (same as cc)
xp
Editing
Transpose two letters (delete and paste, technically)
u
Editing
Undo
.
Editing
Repeat last command
v
Making text (Visual mode)
Start visual mode, mark lines, then do command (such as y-yank)
V
Making text (Visual mode)
Start Linewise visual mode
o
Making text (Visual mode)
Move to other end of marked area
Ctrl + v
Making text (Visual mode)
Start visual block mode
O
Making text (Visual mode)
Move to other corner of block
aw
Making text (Visual mode)
Mark a word
ab
Making text (Visual mode)
A () block (with braces)
aB
Making text (Visual mode)
A {} block (with brackets)
ib
Making text (Visual mode)
Inner () block
iB
Making text (Visual mode)
Inner {} block
Esc
Making text (Visual mode)
Exit visual mode
>
Visual commands
Shift right
<
Visual commands
Shift left
y
Visual commands
yank (copy)marked text
d
Visual commands
Delete marked text
~
Visual commands
Switch case
yy
Cut and Paste
Yank (copy) a line
2yy
Cut and Paste
Yank 2 lines
yw
Cut and Paste
Yank word
y$
Cut and Paste
Yank to end of line
p
Cut and Paste
Put (paste) the clipboard after cursor
P
Cut and Paste
Put (paste) before cursor
dd
Cut and Paste
Delete (cut) a line
dw
Cut and Paste
Delete (cut) the current word
x
Cut and Paste
Delete (cut) current character
:w
Exiting
Write (save) the file, but don't exit
:wq
Exiting
Write (save) and quit
:q
Exiting
Quit (fails if anything has changed)
:q!
Exiting
Quit and throw away changes
/pattern
Search/Replace
Search for pattern
?patten
Search/Replace
Search backward for pattern
n
Search/Replace
Repeat search in same direction
N
Search/Replace
Repeat search in opposite direction
:%s/old/new/g
Search/Replace
Replace all old with new throughout file
:%s/old/new/gc
Search/Replace
Replace all old with new throughout file with confirmations
:e filename
Working with multiple files
Edit a file in a new buffer
:bnext
Working with multiple files
Go to next buffer
:bprev
Working with multiple files
Go to previous buffer
:bd
Working with multiple files
Delete a buffer (close a file)
:sp filename
Working with multiple files
Open a file in a new buffer and split window
Ctrl + ws
Working with multiple files
Split windows
Ctrl + ww
Working with multiple files
Switch between windows
Ctrl + wq
Working with multiple files
Quit a window
Ctrl + wv
Working with multiple files
Split windows vertically