VI EDITOR INFORMATION --------------------- The vi editor is a screen text editor which may be used to edit existing files or create new files. Some useful vi commands are: i - insert at current cursor position I - insert at the beginning of the current line a - insert after current cursor position A - insert at the end of the current line o - insert after the current line O - insert before the current line /xyz - find the next occurrence of string 'xyz' ?xyz - find the previous occurrence of string 'xyz' n - perform the same function as indicated by the last ? or / search command Ns - substitute for N characters whatever is typed up to the ESC key r - same as 1s but needs no terminating ESC R - same as Ns where N is the number of characters typed up to ESC S - substitute for the entire line Ncw - substitute for N words whatever is typed up to ESC Ndw - delete N words Ndd - delete N lines Nx - delete N characters NX - delete the previous N characters :w - write the file to disk :wq (or ZZ) - write the file to disk and quit :q - quit without changing the file :q! - quit without changing the file (leave it as it was at the beginning of this vi session) :I,Js/string-1/string-2/g - substitute string-2 for all occurrences of string-1 from lines I to J Nw - move forward N words Nb - move backward N words NG - go to line N in the file G - go to the end of the file u - undo the previous command % - find the parenthesis matching the one currently positioned at Every insertion of characters into a file must be terminated by an ESC to enter the insertion. Most commands allow an optional number N to precede the command. This causes the command to be executed N times. If this number is omitted, then the default is to execute the command once.