This summary is laid out as follows:
Table B-1. Layout of editor cheat sheets
|Running||Recommended command line for starting it.|
|Using||Really basic howto. This is not even an attempt at a detailed howto.|
|Exiting||How to quit.|
|Gotchas||Oddities to watch for.|
% vi filename
i to enter insert mode, then type text, press ESC to leave insert mode.
x to delete character below cursor.
dd to delete the current line
Cursor keys should move the cursor while not in insert mode.
If not, try hjkl, h = left, l = right, j = down, k = up.
/, then a string, then ENTER to search for text.
:w then ENTER to save.
Press ESC if necessary to leave insert mode.
:q then ENTER to exit.
:q! ENTER to exit without saving.
:wq to exit with save.
vi has an insert mode and a command mode. Text entry only works in insert mode, and cursor motion only works in command mode. If you get confused about what mode you are in, pressing ESC twice is guaranteed to get you back to command mode (from where you press i to insert text, etc).
:help ENTER might work. If not, then see the manpage.