$PRINT$ JDE=DOC,END; ################################################################################ V I H E L P ################################################################################ SPF commands on left, VI commands on right. NVI-specific noted by (NVI: ). For SPF commands, equivalent TSO Edit keystroke commands noted in upper case by [keyname], TSO Edit command line options noted by (=>commandname), TSO Edit line commands noted by (commandname). © Copyright (C) 1993, 1994, 1995, 1996 Jeff Wang. You can do whatever you want with this file, just don't charge money for it :-) -------------------------------------------------------------------------------- ******************************************************************************** SPF FILE COMMAND | VI/NVI FILE COMMANDS EQUIVALENT ******************************************************************************** edit file | vi file edit file at last line | vi + file edit file at line n | vi +n file edit file after running | vi +/pattern file a command first | | vi +":!grep -n pattern %" file | | vi +":g/pattern/d" file | edit another file | :e file2 | :edit file2 [F2 SPLIT] | :e +/pattern file2 | [F9 SWAP] | :e# | Ctrl-^ | edit multiple files | vi file1 file2 file3 ... | | vi `find . -type f -print` | | vi `find . -name *.c -print` | | vi `grep -l "pattern" *` | | vi `egrep -l "pattern1|pattern2|pattern3" *` | | :n | :next | | :n file4 file5 | | :rew | :rewind | | :ar | :args | edit file after system | vi -r crash [=>RECOVER ON] | | vi -r file | browse file | view file | vi -R file | save and exit [F3 END] | ZZ | :x | :wq save file (=>SAVE) | :w | :write save part of the file | :130,$w file2 | | :'a,'bw file2 | | :/pattern1/,/pattern2/w! file2 | append current file to | :w >> file2 another file | save current file under | :w file2 different filename | | :w %.new | | :w new%.ver3 | rename filename without | :f newfilename | :file newfilename modifying the | use vi to rename or | mvi *.dat delete files | CANCEL] edit session | :q! do not save changes | undo any changes made | :e! since last save | ******************************************************************************** SPF CURSOR MOVEMENT | VI MOVEMENT EQUIVALENTS ******************************************************************************** MOVE BY CHARACTER | -------------------------------------------------------------------------------- left arrow | h | [LeftArrow] | Ctrl-H right arrow | l | [RightArrow] | [space bar] up arrow | k | [UpArrow] | Ctrl-P down arrow | j | [DownArrow] | Ctrl-J | Ctrl-N input mode [BackSpace] | [BackSpace] | Ctrl-H -------------------------------------------------------------------------------- MOVE BY TEXT OBJECT | -------------------------------------------------------------------------------- move to new line | [Return] | j | [DownArrow] | Ctrl-M move forward one word | w | W [Alt][RightArrow] | e | E move backward one word | b | B [Alt][LeftArrow] | move backward one word | Ctrl-W move backward to start | Ctrl-U move to beginning of | ) next or previous | ( sentence | move to beginning of | } next or previous | { paragraph | next or previous | [[ section |
-------------------------------------------------------------------------------- MOVE BY LINE | -------------------------------------------------------------------------------- move to start of line | 0 move to end of line | $ move to first of line | ^ | + | - | n_ [Tab] during text input | | Ctrl-I key during text input mode> | Ctrl-T when input at start of line> back up a shiftwidth of | Ctrl-D | 0 Ctrl-D go to last line | G | :$ go to first line | 1G go to line n | nG | :n go down n lines | nj | n[DownArrow] go up n lines | nk | n[UpArrow] move to top of current | H screen | nH move to middle line of | M current screen | move to last line of | L current screen | nL mark cursor position | mx line address for ex | `x commands (can use to | 'x move around quickly) | `` | '' -------------------------------------------------------------------------------- MOVE BY COLUMN | -------------------------------------------------------------------------------- go to column n | n| move n spaces to right | nl | n[RightArrow] | n[space bar] move n spaces to left | nh | n[LeftArrow] -------------------------------------------------------------------------------- MOVE BY SCREEN | -------------------------------------------------------------------------------- scroll up one full | Ctrl-B screen [F7 UP] | nCtrl-B scroll up half-screen | Ctrl-U [F7 UP] HALF | nCtrl-U [F7 UP] n | scroll down half-screen | Ctrl-D [F8 DOWN] HALF | nCtrl-D [F8 DOWN] n | scroll up 1 line | Ctrl-Y scroll down 1 line | Ctrl-E scroll screen | z [Return] [F7 F8] CSR | z. | z- | z+ | z^ | /pattern/z | /pattern/z. | /pattern/z- | -------------------------------------------------------------------------------- MOVE BY FINDING TEXT | -------------------------------------------------------------------------------- find a pattern (=>FIND) | /pattern | ?pattern find a word | /\ | | ?\<[Kk][^ ]*[aeiouAEIOU]\> | repeat find | n (rFIND [F5]) | N find pattern only if it | /pattern1/;/pattern2/;/pattern3/ occurs after another | find nth occurrence of | Ini/pattern[Ctrl-V][Return][Esc]l"xd0@x pattern | <"n" is number of occurrences to search forward; | keystroke sequence outputs a stream of multiple | "/pattern^M" (^M is carriage return) that is | deleted to buffer "x" and executed by entering @x | from wherever the cursor is> | A.na?pattern[Ctrl-V][Return][Esc]F.x"xd$@x | find character on | fc current line | nfc | Fc | nFc | tc | Tc repeat character find | ; display lines having | :g/pattern/p pattern | | :g!/pattern/nu | :v/pattern/nu | | :v/^[A-Za-z0-9]/p | ******************************************************************************** SPF EDIT LINE COMMANDS | VI EDIT EQUIVALENTS ******************************************************************************** INSERT TEXT | -------------------------------------------------------------------------------- insert text [Insert] | i | ni | a | na insert at start of line | I insert at end of line | A insert new line (I) | o | O text split (TS) | i [Return] [Escape] insert non-printing | Ctrl-V control characters | prints ^[ | to quote Ctrl-V itself, press Ctrl-V twice for ^V> return to command mode | Esc [F11] | Ctrl-[ -------------------------------------------------------------------------------- CHANGE TEXT | -------------------------------------------------------------------------------- replace text [overlay] | R | nR replace a character | r | nr change a word | cw | ncw change to end of line | C change to start of line | c0 change to sentence end | c) change range of columns | cn| change to character | cf? change to text pattern | c/pattern | c?pattern change a line | cc | S change n lines | ncc change to end of file | cG change to start of file | c1G substitute a character | s substitute n characters | ns change txt1 txt2 | :s/txt1/txt2/ (=>CHANGE txt1 txt2) | | :s/txt1/txt2/g | | :6,15s/txt1/txt2/ | | :%s/pattern1.*pattern2/txt/g | repeat change | n & | :& | :&g | :%&g change all txt1 txt2 | :%s/txt1/txt2/g (=>CHANGE ALL) | | :%s/txt1/txt2/gc | to negate; Ctrl-C | cancels further changes> | :g/pattern/s/old/new/g | | :g!/pattern/s/old/new/g | :v/pattern/s/old/new/g | regular expressions for | . search patterns | * (wildcard character) | .* | ^txt | txt$ | \ | [ ] | \< | \> es | matches words ending with "es"> | ~ regular expressions for | \ (wildcard character) | \n | & | \u <\u changes next character in replacement to be | \U uppercase; \U changes all characters after it in | replacement string to uppercase unless separated | by \e or \E> | \l <\l changes next character in replacement to be | \L lowercase; \L changes all characters after it in | replacement string to lowercase unless separated | by \e or \E> | ~ change case of letter | ~ invert case of word | ywmnoP:s/[^ ]/\~/g0"nDdd`n@n | invert case of line | !!tr '[a-z][A-Z]' '[A-Z][a-z]' | :s/\([a-z]*\)\([A-Z]*\)/\U\1\L\2/g | change to uppercase | :%s/.*/\U&/ (=>UPCASE ALL) | :/do:/,/end:go/s/.*/\U&/ | | :?^$?,'bs/other/\u&/g | change to lowercase | :%s/.*/\L&/ (=>LOWCASE ALL) | :3,8s/IN EXAMPLE/\L&\e NUMBER/g | | :,'bs/Ex/\l&/g | -------------------------------------------------------------------------------- DELETE / MOVE TEXT | -------------------------------------------------------------------------------- delete a character | x [delete] | X delete n characters | nx | nX delete word | dw [Alt][delete] | ndw delete to end of line | D delete to start of line | d0 delete to sentence end | d) delete range of columns | dn| delete line (D) | dd delete n lines (DD) | ndd | d'a | :/-/d delete to end of file | dG delete to start of file | d1G delete to character | df? delete to text pattern | d/pattern | | d?pattern | | :%s/pattern1.*pattern2//g | delete block of text | ma mb `ad`b | | :m$ | block move n lines (MM) | ndd (p | P) | | "Andd | delete text block to | ma mb `a"cd`b named buffer | paste deleted text from | "ap | "aP named buffer | paste from delete | "np | "nP buffer | <"n" is buffer number 1-9 storing past 9 deletions; (restore deleted text) | last delete is saved in buffer 1; only works for | deleted lines, not deleted strings of text> | "1pu.u.u.u.u.u.u.u.u | transpose two character | xp transpose two words | dwwP transpose two lines | ddp delete lines having | :g/pattern/d pattern | | :g!/pattern/d | :v/pattern/d | | :/pattern1/,/pattern2/d | | d/pattern1/;/pattern2/ | | :g/pattern/-3,-1d|+1,+2d | move lines having a | :g/pattern/mo$ pattern | delete columns of text | :%!colrm f l (=>C ALL P'=' '' f l) | | :'a,.!colrm f l | | :2,10!colrm 1 4 | blank out text columns | :.,$!column f l (=>C ALL P'=' ' ' f l) | | :'a,'b!column 20 | | :%!column 34 55 - | overlay text onto other | :.!yo (:16,26!po) lines of text (C OO) | | :'a,'b!yo (:'c,'d!po) | | !!yo (:'a,.!po | !'a po) | -------------------------------------------------------------------------------- COPY TEXT | -------------------------------------------------------------------------------- copy file (=>COPY file) | :r file | :read file | | :r !sed -n 50,75p file | = 50 && NR <= 75' file > | :r !sed -n "/pattern1/,/pattern2/p" file | copy a file after all | :g/pattern/r file pattern occurrences | copy a command output | :g/pattern/r !Unixcommand after every pattern | <"Unixcommand" output placed after every "pattern"> copy a command output | :r !Unixcommand into current file | copy n numbers of words | nyw (p | P) | copy to end of line | y$ (p | P) | copy to start of line | y0 (p | P) | copy to end of sentence | c) (p | P) | copy a range of columns | yn| (p | P) | copy a line (C) | yy (p | P) | block copy n lines (CC) | nyy (p | P) | | y'a (p | P) | | :'a,'by (p | P) | | :'a,'bco. | copy a text block | ma mb `ay`b (p | P) | repeat a line (R) | yy (p | P) | repeat line n times (Rn)| :1,ng/^/'aco'a | repeat text block (RR) | :'a,'bco'b | (RRn)| :1,ng/^/'a,'bco'b | yank to buffer (=>COPY1)| "anyy (copy to named buffer) | <"a" is one of 26 buffers named a-z; "n" is number | of lines to yank, default of 1 line> | "Anyy | yank a text block to | ma mb `a"cy`b named buffer | paste yanked text from | "ap | "aP named buffer (=>COPY1) | yank lines having | :g/pattern/y a pattern | | :g/pattern/y A | store often-used ex | "add @a | "ayy @a command into buffer | <"add deletes line containing a vi or ex command and execute buffer | sequence and stores it in buffer "a" (or a-z); @a whenever the command | executes stored command in command mode; can is needed | restore delete buffer with "ap if command needs | changing; when using "ayy, enter command on last | line and use 1,$-1 as line address to avoid | running the command on itself; @ buffer commands | may not be more than 512 characters long> | :*a repeat last @ command | @@ -------------------------------------------------------------------------------- REFORMAT TEXT | -------------------------------------------------------------------------------- concatenate text lines | J | nJ | :j n | :join n | | :j! n | :join! n | text flow (TFnn) | !a}fmt -nn | <"a" is number of paragraphs to format; "nn" is | maximum allowed line length; format only a few | paragraphs at a time> justify and block text | :%!format -b -w72 | | :'a,'b!format -i4 -w68 -l | | :1,7!format -c -w80 | | :%!perl -pe 'print " " x int((81-length())/2)' |
| :,8!perl -pe 'print " " x int((73-length())/2)' |
shift lines left/right | << >> | . > shift> block shift n lines | n<< n>> (( or )) | . > shift> | >'a | :8,12s/^/ /g | insert empty line | :%s/$/Ctrl-V[Return]/ between every line | split text up so a new | :%s/Example:/Example:Ctrl-V[Return]/g line is made at every| split text up so each | :%s/[[Space][Tab]][[Space][Tab]]*/Ctrl-V[Return]/g line has only one | CRUNCH) | line; \(.*\)/\1 restores rest of line without any | leading spaces; can use this to prepare text for | embedding of nroff-troff commands) delete spaces and tabs | :%s/[[Space][Tab]]*$// at ends of lines and | delete all blank lines | :g/^$/d | :v/./d | | :g/^[ [Tab]]*$/d | change multiple blank | :%s/[[Space][Tab]]*$// :%!cat -s lines to single blank| convert single text | !}pr -4t column into 4 columns| switch columns of data | :'a,'b!awk '{print $2" "$1" "$3" "$5" "$4}' in a column-oriented | | :%!awk '{printf "\%10s\%10s\%20s\n", $3, $2, $1}' | | :%s/\(...\)\(.......\)\(....\)\(.....\)/\4\3\2\1/ | reverse order of lines | :g/^/mo0 in file (=>FLIP) | sort the lines in file | :%!sort | :%!sort -r | :'a,'b!sort +2 | | :%!perl -00 -e 'print sort <>' | add line numbers to | :%!nl | :%!cat -n start of each line | | :%!pr -t -n | add line numbers to end | 1G of each line | !Gawk '{printf "\%s\%8d\n", $0, NR}' | <1G first moves to start of file; awk adds line | numbers to end of each line; if spacing of numbers | is not okay, "u" undo, and execute command again | using some spacing other than "%8") transpose matrix of | :%!transpose values | translate characters to | :%!tr A-Za-z N-ZA-Mn-za-m other characters | | :%!tr N-ZA-Mn-za-m A-Za-z | | tr '\015' '\012' < file > file1 | regularize spacing and | :%s/\([.?!]\) *\([a-zA-Z0-9]\)/\1 \U\2/g case of sentences | | :%s/\([^.?!]\) *\([^.?!]\)/\1 \2/g | run spelling checker on | :w the file | :$r !spell % -------------------------------------------------------------------------------- SPF EDIT LINE OPERATION | -------------------------------------------------------------------------------- draw a ruler (COLS) | map _ o^[i----+----1----+----2----+----3----+----4 \ | ----+----5----+----6----+----7-^V|--+----8^[0 | -------------------------------------------------------------------------------- exclude text block (XX) | :'a,'b!exclude (!!exclude) from current file | ******************************************************************************** COMMANDS FOR PROCESSING | VI EDIT EQUIVALENTS ******************************************************************************** comment IBM JCL lines | :,$s/^/\/\/\* / | | :/&END/+1,/EXEC DUMP/s/^\/\/\* // | ******************************************************************************** SPF EDIT KEYS/COMMANDS | VI OR EX COMMAND EQUIVALENTS ******************************************************************************** repeat last edit/insert | . command [RETRIEVE] | | 4. | Ctrl-@ | 128 characters were last input> [reset] | Escape key (usually [F11] on DECs) | display current line # | :.= display total number of | := lines in the file | :/pattern/= | display lines with | :number | :nu | :# their line numbers | (address)number(count) | display lines showing | :list | :l tabs and end-of-lines| (address)list(count) | display filename, line | Ctrl-G | :f number, total lines | undo previous change | u (=>UNDO) | U | :e! cancel current partial | Ctrl-U ex/search command | screen refresh [Dup PA1]| Ctrl-L | Ctrl-R | quit vi, invoke ex | Q quit ex, return to vi | :vi run command | :!Unixcommand (=>TSO COMMAND) | < ( ) && || << >> # ; $ | :!! | | :!! arguments | filter text through Unix| :.!Unixcommand command as standard | standard output | !!Unixcommand | | n!!Unixcommand | | !!!Unixcommand | | !}Unixcommand | | :map key | 1G/pattern!/pattern/command | send file contents to | :w ! Unixcommand standard input of | Unix command | define a string as an | :ab string replace_text abbreviation to be | | :una string | change working directory| :cd directory | :chdir directory | :chd directory | copy lines using ex | :co | :copy | :t | (address)co(destination) | :.,.+4co28 | :'a+2,$-4t. | :%co$ > file"> delete lines using ex | :d | :delete | (address)d(bufferletter) | :d b 4 | :'a,'bd | :%d display saved buffers | :display buffers | :di b | display all background | :display screens | :di s screens | display the tags stack | :display tags | :di t | display ex help info | :exusage [ex command] | :exu [ex command] | display vi help info | :viusage [vi command] | :viu [vi command] | display short help line | :help | :he | map a key to commands | :map [k] command map a key to commands | :map [k] command to be executed in | | :unmap [k] | :unm [k] | map a key to commands | :map! replacementcommand to be executed in | to commands in input mode; "command" input mode | cannot use "k" in its definition and cannot be | more than 100 characters; do not make input-mode | keymaps recursive> | :unmap! | :unm! | that was previously mapped> mark current line with | :ma x | :mark x | :k x an letter label | move lines using ex | :m | :move | (address)m(destination) | | :m 'a | :2 m 15 | :.,.+4m0 create exrc file from | :mkexrc exrc_file | :mk exrc_file currently set maps, | preserve current buffer | :pre | :preserve in case of write error| edit previous file from | :prev | :previous argument list | recover file from system| :rec | :recover save area after | create a new shell from | :!sh | :!csh | :!ksh vi | exit | Ctrl-D exit from vi to current | Ctrl-Z | :stop | :st | :suspend | :su (fg) shell | execute ex commands | Q :so filename | Q :source filename stored in file | split current screen in | :E [files...] two [F2 SPLIT] | foreground a screen that| :fg [file] was backgrounded | resize split screens | :resize +/-size | :res +/-size | | ctags *.c *.h ~/lib/*.h | edit tagged program | :ta Segmentnametag | :tag Segmentnametag segment (very quick | way to hop around in | :vi -tSegmentname up to three different| segments of code that| Ctrl-] may be in other files| undo all changes made by| :u | :undo last editing command | print vi program version| :ver | :version yank lines using ex | :ya | :yank | :y | (address)ya(bufferletter) | :y a 4 | :12,19 y shift lines left/right | :(address)<(count) | :(address)>(count) in ex | :> | :<8 line address of ex | none commands | $ | . | - | --- | + | ++ | n | % | g | .-n | .+n | 'a | '' | /pattern/ | ?pattern? | a,b | 'a,'b | a+n,a-n <"n" lines after or before "a" where "a" is | any address described above; second address | must not precede first address> ******************************************************************************** VI/NVI OPTION SETTINGS | DESCRIPTION ******************************************************************************** All toggle flag options can be disabled by adding prefix 'no' to option name Options may also be specified using the abbreviations shown in brackets. -------------------------------------------------------------------------------- :set all | Display all current option settings. :set | Display only options changed from default setting. :set option | Set specified "option". :set option? | Display set value of specified "option". :set altwerase | NVI: Change how words are erased during input. Text is | broken into clases: alphanumerics and underscore, | other nonblank characters, and blank characters. | Def: noaltwerase. :set autoindent (ai) | Good for programming; indent next line same distance | distance as previous line; Ctrl-T or Ctrl-D (input | mode) add or remove indent levels based on tabstop | setting. Def: noai. :set autoprint (ap) | Display changes after each editor command. Def: ap. :set autowrite (aw) | Automatically write file if changed before opening | another file with :n or before giving Unix command | with :!. Useful when editing two or more files | simultaneously. Def: noaw. :set beautify (bf) | Ignore control characters during input (except tabs, | newlines, and formfeeds). Def: nobf. :set cdpath=":" | NVI: Specify colon-separated list of directories used | as path prefixes for relative pathnames used in the | ':cd' command. Def: CDPATH variable if set, or | current directory. To reference current directory, | use either empty string or "." in CDPATH variable. :set columns=?? (co) | NVI: Number of columns in screen; setting causes ex/vi | to reset COLUMNS variable: Def: co=80. :set comment | NVI: If first non-empty line of file begins with "/*", | nvi skips to end of that C comment block before | displaying file. Def: nocomment. :set directory=? (dir) | Store buffer files in specified directory. Def: /tmp. :set digraph (dir) | NVI: :set edcompatible | Use ed-like features on substitute commands. Def: | noedcompatible. :set errorbells (eb) | Sound bell when error occurs. Def: errorbells. :set exrc (ex) | NVI: If 'noexrc' is set in the system or $HOME .*exrc | files, local .*exrc files are never read (unless | they are the same as the system or $HOME .*exrc | files). Setting 'exrc' on has no effect; the normal | local .*exrc files checks are done. Def: noexrc :set extended | NVI: Regular expressions are extended (i.e. egrep) | format. Def: noextended. :set flash | NVI: Flash screen instead of beep keyboard on error. | Def: flash. :se hardtabs=? (ht) | Define boundaries for terminal hardware tabs. Def: | ht=8. :set ignorecase (ic) | Disregard case of characters in searches. Def: noic. :set keytime=? | NVI: 10th's of a second ex/vi waits for full keymap | sequence. Def: keytime=6. :set leftright | NVI: Scroll screen left-right for long lines instead | of folding lines at right margin. Def: noleftright. :set lines=? (li) | NVI: Number of lines in screen. Setting this causes | ex/vi to reset LINES variable. Def: li=24. :set lisp | Insert indents in appropriate lisp format. Def: nolisp :set list | Display tabs as ^I and ends of lines as $. Def: nolist :set magic | Wildcard characters . * [] ~ have special meaning when | used in patterns. Def: magic. :set matchtime=? | NVI: 10th's of a second ex/vi pauses on matching | character when showmatch set. Def: matchtime=7. :set mesg | Permit system messages to display on terminal while | editing, which may disrupt display; use Ctrl-L to | restore screen display. Def: mesg. :set modeline | After vi reads EXINIT variable and .exrc file, first | and last 5 lines of edit file are read for extra ex | commands; embedded commands must begin with "ex:" | or "vi:" and must be valid ex editor commands; | separate multiple commands with "|"; each line must | be terminated with :. Def: nomodeline. :set number (nu) | Display line numbers left of screen. Def: nonu. :set octal | NVI: Display unknown characters as octal numbers, | instead of default hexidecimal. Def: nooctal. :set open | Allow entry to open or visual mode from ex. Def: open. :set optimize (opt) | Abolish carriage returns at end of lines when printing | many lines; speeds output on dumb terminals when | displaying lines with leading white spaces (blanks | or tabs). Def: noopt. :set paragraphs=??? | Define paragraph delimiters for movement by {}. Pair (para)| of characters used in value are nroff/troff macros | that begin paragraphs. :set prompt | Display ex prompt (:) when vi Q command given. Def: | prompt. :set readonly (ro) | Any file writes will fail unless ! is used after the | write (using w, ZZ, or autowrite). Def: noro. :set redraw (re) | Redraw screen whenever edits are made. Noredraw useful | on slow dumb terminals; deleted lines show up as @ | and inserted text appears to overwrite existing | text until [Esc] pressed. Def: depends on line | speed and terminal. :set remap | Allow nested map sequences. Def: remap. :set report=? | Display message on prompt line whenever edit is made | that affects at least a certain number of lines. | Def: report=5. :set ruler | NVI: Display row/column on command line. Def: noruler. :set scroll=?? | Amount of lines to scroll. Def: half of window. :set sections=?? ?? | Define section delimiters for movement by [[ ]]. Pair | of characters used in value are nroff/troff macros | that begin sections. :set shell=???? (sh) | Define pathname of shell used for shell escape ':!' | and shell command ':sh'. Def: path derived from | existing shell environment. Def: SHELL variable. :set shiftwidth=? (sw) | Define number of spaces for backward tabs when | autoindenting or shifting lines with <> command. | Def: sw=8. :set showdirty | NVI: Display asterisk on command line if file has been | modified. Def: noshowdirty. :set showmatch (sm) | Good for programming; when ) or } is entered, cursor | moves briefly to matching ( or {; if no match made, | error bell rings. Def: nosm. :set showmode | NVI: Display current edit mode on command line. Def: | noshowmode. :set sidescroll=?? | NVI: Set number of columns shift to left-right when | using leftright scrolling and left-right margin is | crossed. Def: sidescroll=16. :set slowopen (slow) | Hold off display during insert. Def: depends on line | speed and terminal type. :set sourceany | Start vi using other person's startup files; security | risk, so do not use! Def: nosourceany. :set tabstop=? (ts) | Define number spaces spaces. Def: ts=8. :set taglength=? (tl) | Define number of characters significant for tags. Def: | tl=0, all characters significant. :set tags=?? ??? | Define pathname of files containing tags. Def: system | searches /usr/lib/tags and file "tag" in current | directory. :set term=vt??? | Define terminal type. :set terse | Display shorter error messages. Def: noterse. :set tildeop | NVI: Modify ~ command to take associated motion. Def: | notildeop. :set timeout (to) | Time out a keyboard map after 1 second; useful for vi | versions that allow mapping a keystroke sequence. | Def: to. :set ttywerase | NVI: Change how words are erased during input. Option | breaks text into two classes, blanks and non-blank | characters. Def: nottywerase :set ttytype=vt??? | Define the terminal type. :set verbose | NVI: Display error message on command line instead of | ringing bell for all errors. Def: noverbose. :set warn | Display warning "No write since last change". Def: | warn. :set window=?? (w) | Display specified number of lines on screen. Def: | depends on line speed and terminal type. :set wrapmargin=? (wm) | Define right margin as n number of spaces from end of | line; automatically inserts carriage returns to | break lines. Def: wm=0. :set wrapscan (ws) | Continue search around either end of a file. Def: ws. :set writeany (wa) | Allow saving to any file. Def: nowa. ******************************************************************************** OTHER NOTES ABOUT VI ******************************************************************************** Some vi commands have opposite lowercase and uppercase meanings. Usually, lowercase means to execute the command after or below the current cursor or line location; uppercase means to execute the command before or above the current cursor or line location. Thus, the vi paste command (P or p) is case-sensitive to have the same effect for copy and move commands as 'b' or 'a' have to denote before or after a specific line number in SPF Edit. Edit commands c (change), d (delete), y (yank) can have a movement command as a suffix to modify the meaning. cc, dd, yy operate on an entire line. But c^ will change text from beginning of line to cursor position, cb will change a word from its beginning up to cursor postion, d$ (or D) will delete from cursor position to end of line, de will delete a word from cursor position to end of word, y$ will yank text to buffer from cursor position to end of line and p will paste the yanked text after the new cursor position, y3w will yank to buffer 3 consecutive words starting from cursor position and P will paste those 3 yanked words before the new cursor position, etc, etc. Thus, change, delete, and yank have the general format (number)(command)(movement) where (number) is the number of occurrences, (command) is either c, d, or y, and (movement) is a movement command. vi also distinguishes between "line" and "character" moves. If change, delete, or yank are used with ex line addresses, entire lines are acted upon. If those commands are used with / or ? being the (movement) command, only the text starting from the current cursor position the character pattern searched for is acted upon. Most vi commands can also have a numeric count as a prefix. Thus, 5w will move the cursor ahead by 5 words, 2( will move the cursor back 2 sentences. vi toggles between the command mode and text input mode by pressing the key (usually F11). Most keys have a function in command mode. If you are new to vi, and are not sure if you are in command or input mode, or if you think you may have typed a key by mistake, press until your terminal beeps to get back to command mode. If you typed a key by accident and changed your file, enter 'u' to undo whatever last change was made to the file. The vi commands that enter input mode are : i, a, I, A, o, O, c, C, s, S, R. The last line of the display is always saved for reading input from : (for ex and shell commands), / (forward search command), ? (backward search command), or ! (shell command to filter a text object through). EX commands have format :(line_address)(command)(parameters)(count)(flags) where (line_address) defines lines to be affected, (command) defines type of operation, (parameters) define arguments or options, (count) defines optional or required number of lines affected by command, and (flags) define actions to be taken upon completion of command (e.g., p to print line after executing the command; l to print line along with EOL and tabs, c to confirm each change before making it, g to globally repeat command across the line; only g and c are usually needed in vi mode invoking of ex). The EX line_address is usually input in pairs separated by "," or ";". If no beginning address is given, the current line is assumed ".". If ";" is used as a separator, the address before the semicolon becomes the current line address relative to the next address reference. An input mode keymap can be used like the :ab abbreviation facility with the following key differences. The abbreviation mechanism waits to see what the NEXT character after the abbreviation is going to be before deciding whether to make a substitution, and if the sequence was not preceded by a non-alphanumeric character (or by the top of the file), the abbreviation mechanism doesn't start working at all. By contrast, an input mode keymap mechanism instead starts a per-character timer that begins whenever you type the first character of a remapped sequence. If there is an input mode keymap corresponding to multiple characters, when you type the first character of that string, nothing will be echoed to your screen unless you type some character other than the second character of the keymap, or unless you type nothing at all within the set vi "timeout" period, typically about two seconds long. In short, vi watches to see if you have typed the beginning of an input mode keymap sequence, and if the sequence is longer than a single character, vi waits to see if you will type the complete sequence, in which case vi will supply whatever remapping you have specified for the sequence you've just typed. This will happen regardless of what follows the remapped sequence. To negate the expansion of a set abbreviation, enter Ctrl-V right after you have typed the abbreviated sequence (to tell vi that you want to use the character string literal as opposed to having it expand out as an abbreviation). To negate the execution of a set input mode keymap, enter Ctrl-V before you have typed the keymapped sequence. Abbreviations (:ab) must be activated in input mode, but command and input mode keymaps, once they have been activated from their respective modes, may hop back and forth between command and input modes during the keymap sequence. If you do a yank from within a macro into a named buffer, vi may tell you that you cannot yank from inside a macro, or put inside a macro. This is sometimes untrue (the message may come up due to a bug in the program logic). You may be able to get around this by making the yank the first thing that happens in the macro. -- >> Jeff Wang / jeffw@advance.com / jeffw@jeffw.com / nnnnoise@interramp.com << >> Landmark Graphics Corporation #====}==) Ext: 3409 (=={====# << >> Advance Products Group #===(==} Fon: (303)779-8080 {==)===# << >> 7409 South Alton Court, Suite 100 #====}==) Fax: (303)796-0807 (=={====# << >> Englewood, Colorado 80112 #===(==} Tlx: 984254(AGC UD) {==)===# <<