Just enough vi editor commands to survive vi starts in command mode. Can precede most commands with a number indicating how many times to do a command. For example, hitting 42 followed by the down arrow will move the cursor down 42 lines. "42x" will delete 42 characters. ESC Change to command mode. Command mode: Move cursor with arrow keys. If there aren't any arrow keys, j,k,h,l works. i Change to insert mode. Insert before cursor. a Change to insert mode. Insert after cursor. r Replace 1 character. R Overwrite mode. x Delete 1 character. dw Delete 1 word. dd Delete 1 line. P Put deleted text before cursor. p Put deleted text after cursor. G Go to end of file. If preceded by a number, go to that line. 1G is a way to go to the start of a file. ctrl-G Display line number where cursor is. J Join. Merge next line with this line. / Search. Follow "/" with text to find. : Change to command line. ":" prompt appears at bottom of screen. Command line: wq Write file and Quit q! Quit, don't save file. %s/old/new/g Substitute. Replace "old" with "new" on all lines. r file.txt Read "file.txt" into editor at line after cursor location. If you've never used vi before, here's a typical editor session: 1. Type "vi file.txt" at Unix command line prompt. 2. Move cursor to place where new text will be added. 3. Type "i" to change to insert mode. 4. Type new text. 5. Type ESC to go back to command mode. 6. Type ":" to go to command line. 7. At vi command line prompt, type "wq" and ENTER to write the file and quit.