Google

vi commands

vi commands

Contact:[email protected]

a Append after cursor.
A Append to end of line.
v C Change the rest of current line.
cw Change the current word.
i Insert before cursor.
I Insert before first non blank line.
o Open a line below for insert
O Open a line above for insert.

:w Write the buffer to file.
:wq Write the buffer to file and quit.
:ZZ Save changes and exit.
:w Save changes and exit.

j Moves the cursor up one line.
k Moves the cursor down one line.
l Moves the cursor right one character.
h Moves the cursor left one character.

ESC
:223

/foo

/foo\ bar

0 Move to beginning of line.
$ Move to end of line. B Back up one word.
E Move forward one word.
G Move to the bottom of the buffer.
H Move to the top line on the screen.
L Move to the first non whitespace character.
M Move the cursor to the middle of the screen.
N Scan for next search match but opposite direction.
n Scan for next search match in the same direction.

:1,$s/up/right/  search and replace up with right


Back to the Index