Vi

Navigation

Command Description
G Go to the last line in the file
:0 Go to the first line in the file
:n Go to the nth line in the file
0 Go to the beginning of the line
$ Go to the end of the line
w Go forward to the next white space or punctuation
W Go forward to the next white space
b Go back to the next white space or punctuation
B Go back to the next white space
% Go to the matching {} or ()

Editing

Command Description
dd Delete the current line
dw Delete the current word
dW Delete the everything until the next space
x Delete the current character
. Repeat the last command
J Remove the carriage return at the end of the current line
~ Toggle the case of the current character