The Basics |
i | vim is now in insert mode. You can type text normally, navigate using the arrow keys and use backspace to delete. Having said that, do not stay in insert mode. |
Esc | vim is now in normal (not insert) mode, and you can use all the other commands mentioned below. |
:w | Save the file. |
:q | Quit out of vim. |
:wq | Save the file and quit out of vim. |
/meowww | Search the document for the text following the slash, (in this case meowww) |
u | Undo the last action. |
Navigating |
h | Move the cursor one character to the right. Does the same thing the right arrow key does. |
j | Move the cursor one line down. Does the same thing the down arrow key does. |
k | Move the cursor one line up. Does the same thing the up arrow key does. |
l | Move the cursor one character to the left. Does the same thing the left arrow key does. |
A (Shift + a) | Takes you to the end of the current line and enters insert mode. |
0 | Takes you to the beginning of a line. |
Cutting, Copying, Overwriting and Deleting |
r | Overwrites the character under the cursor with the character you type after r. |
x | Deletes the character under the cursor. |
dd | Deletes current line and copies it to the buffer. |
yy | Copies the current line to the buffer. |
p | Pastes whatever is on the buffer bellow the line. |
P (Shift+P) | Pastes whatever is on the buffer above the current line.. |