keys COMMAND MODE ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Ctrl-B Page Up ³Alt-C Copy Ctrl-C Toggle Case Sens. ³Alt-D Delete Block Ctrl-D Half Page Up ³Alt-F Display File Name Ctrl-E Scroll Up ³Alt-H Help Ctrl-F Page Down ³Alt-K Cut Ctrl-H Left ³Alt-M Mark Ctrl-I Next Tab Stop ³Alt-O Print Ctrl-J Down ³Alt-P Paste Ctrl-K Up ³Alt-X Return to BRIEF Ctrl-L Right ³Enter Nonwhite, Next Line Ctrl-P Playback ³Ctrl-Enter Nonwhite, Previous Line Ctrl-R Remember ³Space Right Ctrl-U Half Page Down ³Backspace Left Ctrl-Y Scroll Down ³Tab Next Tab Stop Ctrl-Z Suspend Session ³Shift-Tab Back Tab PgDn ==> Next PageÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Home Top of Window ³End End of Line PgUp Page Up ³PgDn Page Down Left Left ³Shift-Up Change Window Right Right ³Shift-Down " Up Up ³Shift-Left " Down Down ³Shift-Right " Ins Insert Mode ³Del Delete Character ³ 0 Beginning of Line ³$ End of Line " Select Scrap Buffer ³% Delimiter Match + Nonwhite, Next Line ³- Nonwhite, Previous Line < Outdent Lines ³> Indent Lines ^ First Nonwhite ³| Go to Column ` Go to Bookmark ³' Go to Bookmark (Nonwhite) \ Set Tab Stops ³ Toggle Case : Extended Command ³@ Execute Command PgDn ==> Next PageÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄPgUp ==> Previous Page ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ , Reverse Char Search ³; Repeat Char Search / String Search Fwd ³? String Search Back ³ A Append at EOL ³a Append at Cursor B Previous Word Alpha ³b Previous Word C Change to EOL ³c Change (operator) D Delete to EOL ³d Delete (operator) E End of Word Alpha ³e End of Word F Char Search Back ³f Char Search Fwd G Go to Line ³g Go to Line H Top of Window ³h Left I Insert at Nonwhite ³i Insert Mode J Join Lines ³j Down ³k Up L End of Window ³l Right M Middle of Window ³m Drop Bookmark PgDn ==> Next PageÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄPgUp ==> Previous Page ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ N Reverse String Search³n Repeat String Search O Open Line Above ³o Open Line Below P Paste Before Cursor ³p Paste After Cursor R Replace Mode ³r Replace Character S Substitute Lines ³s Substitute Characters T Char Before Back ³t Char Before Forward U Undo ³u Undo W Next Word Alpha ³w Next Word X Delete Previous Char ³x Delete Next Char Y Yank Lines ³y Yank (operator) ZZ Save, then Quit ³z Line to Top of Window z. Line to Middle ³z- Line to Bottom ³ ³ ³ ³ PgDn ==> Next PageÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄPgUp ==> Previous Page INSERT MODE REPLACE MODE ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Esc Command Mode ³Esc Command Mode ³ Tab Space to Tab Stop ³ Shift-Tab Destructive Back Tab ³ ³Backspace Undo ³ Enter New Line ³Enter New Line Left Left ³Left Left Right Right ³Right Right ³ ³ ³ ³ ³ ³ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄPgUp ==> Previous Page extended vi_command EXTENDED COMMANDSÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ :a Toggle auto-indent ³:t Set tabs :b Buffer list ³:w Write file :d Delete window ³:w Write to new file :e Edit file ³:wq Write, then quit :k Delete macro file ³:w! Overwrite file :l Load macro file ³:x Exit immediately :m Move (resize) window ³:! Run DOS command :n Next buffer ³:!! Repeat last DOS command :o Open new window ³ :q Quit (no changes) ³ :q! Quit (cancel changes)³ :r Read file ³ :s///g Global replace :s///p Query replace :s/// Replace ³ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ copy,cut,mark,paste,print blocks Copy, Cut, Mark, Paste, and Print work exactly as they do outside the emulator; that is, with normal marks and the regular scrap. In VI, block operations are more commonly performed by using operators in conjunction with cursor movement commands. For example, y$ will copy everything from the cursor to the end of the line to the scrap. (y is the yank operator; $ is the end-of-line command.) See Operators for a description of the operators and the commands they work with. Block operations normally use the regular scrap, but may also use a separate named scrap. Names may be any letter or digit, and (along with a quote) precede the command. For example, "a8x will cut the next 8 characters to the scrap buffer named a. PgDn ==> Next Page These additional commands will work with named scraps: [n]p Paste (n times) after cursor [n]P Paste at cursor [n]s Substitute characters (cut, then insert) [n]S Substitute lines [n]x Cut the next n characters [n]X Cut the last n characters PgUp ==> Previous Page files Here are the buffer- and file-related commands: :a Toggle auto-indent mode :b Buffer list :e Edit file :n Next buffer :q Quit (no changes made) :q! Quit (cancel changes) :r Read file into current buffer :t Set tabs for current buffer [n]\ Set tabs (default = every 3 columns) :wq Write, then quit ZZ Write, then quit :w Write changes to file :w Write to new file :w! Overwrite file :x Exit immediately miscellaneous vi_mark vi_repl_char [n]< Indent lines by a tab [n]> Outdent lines by a tab [n]~ Change case of current character [n]J Join line with the next [n]r Replace n characters with m Drop bookmark (char must be a digit) u Undo xp Reverse the order of the next two characters :k Delete macro file :l Load macro file @ Execute command Playback Remember Suspend session :! Run DOS command :!! Repeat last DOS command (3 character minimum) vi_ins,vi_rep,vi_return modes Unlike BRIEF, VI has three "modes": command mode, insert mode, and replace (overstrike) mode. Insert and replace are used just to enter text; to do anything more sophisticated, you have to get back into command mode first. On the other hand, in command mode, everything you type is interpreted as a command rather than as a direct change to the buffer. The keys normally used to switch modes are as follows (note that there is no direct way between insert and replace modes): to i to to R to PgDn ==> Next Page The following commands also may be used to enter insert mode: a Append (insert after cursor) A Append to end of line c Change (see Operators) C Change to end of line I Insert at first non-white character after cursor o Open blank line below current O Open blank line above current [n]s Substitute characters (delete, then insert) [n]S Substitute lines Command mode is the default when VI emulation is invoked. To return from it to the normal BRIEF environment, use . PgUp ==> Previous Page moving vi_do_mark 0 vi_do_mark 1 [n] Page up [n] Half page down [n] Scroll up one line [n] Page down [n] Cursor left [n] Next tab stop [n] Previous tab stop [n] Cursor down [n] Cursor up [n] Cursor right [n] Half page up [n] Scroll down one line PgDn ==> Next Page 0 Beginning of line $ End of line ^ First non-white character on line [n]+ First non-white on next line [n]- First non-white on previous line [n]| Go to numbered column (defaults to beginning of line) [n]G Go to numbered line (defaults to end of file) [n]H Top of window or # lines below it [n]M Middle of window or # lines below it [n]L Bottom of window or # lines before it z Line to top of window z. Line to middle of window z- Line to bottom of window PgDn ==> Next Page PgUp ==> Previous Page [n]w Next word (delimited by white space) [n]W Next word (delimited by alphanumeric) [n]b Previous word (white space) [n]B Previous word (alphanumeric) [n]e End of word (white space) [n]E End of word (alphanumeric) ` Go to bookmark (char must be a digit) ' Go to first non-white character before bookmark PgUp ==> Previous Page operators In VI, cutting and copying are called deleting and "yanking". VI also supports "changing", which is deleting followed by entering insert mode. These operations are generally performed by specifying the delete, change, or yank operator, and then specifying a cursor movement command. A temporary mark is dropped, the cursor is moved, and the operation is done to the marked block. The basic operators are: d Delete (cut) c Change (cut and insert) y Yank (copy) There are shorthand commands for the commonest operations: PgDn ==> Next Page D Delete to end of line [n]dd Delete n lines C Change to end of line [n]cc Change to the end of the nth line [n]Y Yank lines [n]yy Yank lines For example, to cut four lines to the scrap, you could use 4dd. (You may use a named scrap; see "Blocks" for more information.) Cursor movement commands that may be preceded by an operator include beginning of line, end of line, and first non-white character on line; go to line; the word movement commands; and the go to bookmark commands. prefixes Many VI commands may be prefixed by a repeat count. For example, 4 will scroll down four lines instead of the usual one. These commands are indicated throughout this help menu by the notation [n] prefacing the command itself. VI has additional prefixes that modify commands. For a description of operators that instruct a command to act on a particular region (line, word, marked area, etc.), see "Operators". For a description of commands that accept the name of a scrap buffer, see "Blocks". searching vi_srch_back vi_srch_fwd vi_search [n]/ String search forward [n]? String search backward [n]n Repeat search [n]N Repeat search in reverse direction % Find matching (), {} or [] Toggle case sensitivity [n]f Character search forward [n]F Character search backward [n]t Find character before [n]T Backward search for character before [n]; Repeat f,F,t or T [n], Reverse repeat of f,F,t or T :s///g Replace (global) :s///p Replace (prompted) :s/// Replace (single) windows :o Open new window :d Delete window :m Move (resize) window Move to window in appropriate direction