Command Function
h Move one character LEFT
j Move one character DOWN
k Move one character UP
l Move one character RIGHT
b Move BACK one word
f Move FORWARD one word
[count] e Move FORWARD to the end of word [count][count] E Move FORWARD to the end of WORD [count] 0 or HOME beginning of line
g0 or g HOME beginning of line when line wraps
$ or END end of line
gg beginning of file
G end of file
[int]f[char] To [int]th occurrence of [char] to the right
[int]F[char] To [int]th occurrence of [char] to the left
[int]t[char] Till before [int]th occurrence of [char] to the right
[int]T[char] Till before [int]th occurrence of [char] to the left
[int] j Move [int] lines downward
[int] CTRL-J
[int] CTRL-N
[int] k Move [int] lines upward
[int] CTRL-P
[int] h Move [int] lines to the left
[int] l Move [int] lines to the right
zc Close fold (depends on foldmethod) zo Open fold (depends on foldmethod)
Manipulation
12
Ctrl-u Cut all BEFORE cursor
Ctrl-k Cut all AFTER cursor
Split & Diff
Open two files in diff mode
vim -d file.one file.two
Commands while in diff mode
123456789101112131415
Ctrl-w Ctrl-w Switch windows
Ctrl-w h Move to window LEFT
Ctrl-w j Move to window DOWN
Ctrl-w k Move to window UP
Ctrl-w l Move to window RIGHT
Ctrl-w t Move to the TOP window
Ctrl-w b Move to the BOTTOM window
Ctrl-w H Move window to the far LEFT
Ctrl-w J Move window to the BOTTOM
Ctrl-w k Move window to the TOP
Ctrl-w L Move window to the far RIGHT
Ctrl-w = Make both windows equal after terminal resize
Display the differences between the currently open file and the saved version
(this is great for seeing what the differences are in a recovered file)