UNIX V: vi

-------------------------------------------------------------------------------
|                              Vi Survival Guide                               |
+------------------------------------------------------------------------------|
|vi filename    | How to start up vi. Good luck!                               |
----------------+--------------------------------------------------------------
|ESC ESC CTRL-L | Panic.  Usually fixes things up.                             |
+------------------------------------------------------------------------------|
|ESC            | Gets you out of insert mode.  Does nothing  in  move  around |
|               | mode.  Gets you out of command mode.                         |
----------------+--------------------------------------------------------------
|CTRL-L         | Redisplays the screen                                        |
+------------------------------------------------------------------------------|
|Arrow keys     | Move you around if your terminal is set up right.            |
----------------+--------------------------------------------------------------
|k              | Up one line (Move mode)                                      |
+------------------------------------------------------------------------------|
|CR             | Down one line (Move mode)                                    |
----------------+--------------------------------------------------------------
|CTRL-H         | Left one space (Move mode)                                   |
+------------------------------------------------------------------------------|
|space          | Right one space (Move mode)                                  |
----------------+--------------------------------------------------------------
|$              | Move to the end of the line (Move mode)                      |
+------------------------------------------------------------------------------|
|0              | Move to the beginning of the line (Move mode)                |
----------------+--------------------------------------------------------------
|10G            | Go to line 10 (Move mode)                                    |
+------------------------------------------------------------------------------|
|0G             | Got to the last line in the file (Move mode)                 |
----------------+--------------------------------------------------------------
|i              | Begin inserting just before the character the cursor is  on. |
|                 Finish with ESCAPE. (Move mode)                              |
+-----------------------------------------------------------------------------|
|a              | Begin inserting just after the character your cursor is  on. |
|               | Finish with ESCAPE.                                          |
+---------------+--------------------------------------------------------------
|ESCAPE         | Terminates insert mode                                       |
+------------------------------------------------------------------------------|
|dd             | Deletes the line your cursor is on                           |
+---------------+--------------------------------------------------------------
|d SPACE        | Deletes the character your cursor is on.                     |
+------------------------------------------------------------------------------|
|dw             | Deletes the word your cursor is on.                          |
----------------+--------------------------------------------------------------
|d10d           | Deletes 10 lines starting from the line your cursor is on.   |
+------------------------------------------------------------------------------|
|u              | Undoes your last edit.                                       |
----------------+--------------------------------------------------------------
|cw             | Changes the current word you are on.  Terminate with ESCAPE. |
+------------------------------------------------------------------------------|
|r character    | Replaces the character directly under the cursor.            |
----------------+--------------------------------------------------------------
|R              | Goes into replace mode.  Allows you to type over characters. |
|               | Terminate with ESCAPE.  Cursor movements are not allowed.    |
+------------------------------------------------------------------------------|
|:wq CR         | Command mode.  Write the file and quit.                      |
----------------+--------------------------------------------------------------
|:w CR          | Command mode.  Write the file and stay.                      |
+------------------------------------------------------------------------------|
|:q CR          | Command mode. Quit the file if no changes.                   |
----------------+--------------------------------------------------------------
|:quit! CR      | Command mode. Quit the file and abandon changes.             |
+------------------------------------------------------------------------------|
|ESCAPE         | Terminates command mode. Does not execute command.           |
-------------------------------------------------------------------------------

Next Slide