Basic VIM commands to get you started
Adding Text
| Action | Command |
|---|---|
| Insert at current position | i |
| Insert on character to the right | a |
(You can get a bit more detail regarding the difference between these two here.)
Saving
For every command shown, begin with Esc + :
| Action | Command |
|---|---|
| Save | w + Enter |
| Save and quit | wq + Enter |
| Save and quit | x + Enter |
| Quit (ignore changes) | q! + Enter |
Navigating
| Action | Command |
|---|---|
| Beginning of Document | gg |
| End of Document | Shift+G |
| Go to Line 31 | 31 Shift+G |
| Beginning of Line | 0 |
| End of Line | $ |
| Ahead one word | w |
| Ahead 5 words | 5 w |
| Back one word | b |
| Back 5 words | 5 b |
Editing
| Action | Command |
|---|---|
| Delete the current line | dd |
| Delete n lines To delete 3 lines total (the line you’re on, plus two below), type d, then “dd”. | n dd |
