Instructions from https://www.cs.colostate.edu/helpdocs/vi.html
| $ vi filename | edit filename starting on line 1 |
vi is case sensitive
press <Esc> to exit insert mode
| : (colon) | moves cursor to bottom of screen |
| :x | quit vi, save and quit |
| :q! | quit without saving |
^ (ctrl key)
| j or <return> | down a line |
| k | up a line |
| h | left |
| l | right |
| 0 | start of current line |
| $ | end of current line |
| ^f | down screen f=forward one screen |
| ^b | up screen b=back one screen |
| ^d | down half screen |
| ^u | up half screen |
| u | undo |
| i | insert before cursor, until <esc> pressed |
| a | append after, until <esc> pressed |
| o | insert line after current line o=open new line |
| O | insert line before current line |
| r | type over, r=replace single character until |
| x | delete character under cursor until |
| dd | delete line |