INTRODUCTION TO THE VI EDITOR The software package "vi" has two modes of operation, command mode (for entering commands) and text mode (for entering text). You enter command mode by touching the ESC key (if you are already in command mode, your terminal will beep at you). There is a visual indication that you are in text mode on the right-hand side at the bottom of the current window ("INSERT MODE", "APPEND MODE", or "REPLACE MODE"). Starting the editor: vi filename All the commands listed below require you to be in command mode. Commands may be several characters long. Controlling an editing session: :w (save all changes to disk) :wq (save all changes to disk and exit the editor) :q! (exit the editor without saving any changes) Cursor Movement: up arrow or k (move up one line) down arrow or j (move down one line) left arrow or h (move left one character) right arrow or l (move right one character) ctrl f (next screen) ctrl d (next half screen) ctrl b (previous screen) ctrl u (previous half screen) H (top of screen) L (bottom of screen) 0 (start of line) $ (end of line) G (last line) nG (go to line n) Text Operations: x (delete one character at cursor position) D (delete from cursor position to end of line) dd (delete entire line) r (replace character at cursor position by next character entered) R (replace characters until ESC is entered) i (insert characters to left of cursor position until ESC is entered) a (insert characters to right of cursor position until ESC is entered) o (create a blank line below current line and enter text mode) J (append the line below to the end of the current line) Additional information about "vi" is available as on-line documentation.