home *** CD-ROM | disk | FTP | other *** search
/ ftp.muug.mb.ca / 2014.06.ftp.muug.mb.ca.tar / ftp.muug.mb.ca / pub / muuglines / source / vi-help / vi.reference < prev   
Text File  |  1994-01-22  |  34KB  |  655 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.     ////////////////////////////////////////////////////////////////////////
  7.     /                         VI REFERENCE                                 /
  8.     ////////////////////////////////////////////////////////////////////////
  9.  
  10.     Warning: some vi versions don't support the more esoteric features
  11.     described in this document.  You can edit/redistribute this document
  12.     freely, as long as you don't make false claims on original authorship.
  13.  
  14.     Author: Maarten Litmaath <maart@nat.vu.nl>
  15.     Version: 8
  16.  
  17.     /////////////////
  18.     / contributions /
  19.     /////////////////
  20.  
  21.     Rich Salz <rsalz@bbn.com>
  22.     Eamonn McManus <emcmanus@cs.tcd.ie>
  23.     Diomidis Spinellis <diomidis%ecrcvax.uucp@pyramid.pyramid.com>
  24.     Blair P. Houghton <bph@buengc.bu.edu>
  25.     Rusty Haddock <{uunet,att,rutgers}!mimsy.umd.edu!fe2o3!rusty>
  26.     Panos Tsirigotis <panos@boulder.colorado.edu>
  27.     David J. MacKenzie <djm@wam.umd.edu>
  28.     Kevin Carothers <kevin@ttidca.tti.com>
  29.     Dan Mercer <mercer@ncrcce.StPaul.NCR.COM>
  30.     Ze'ev Shtadler <steed@il4cad.intel.com>
  31.     Paul Quare <pq@r2.cs.man.ac.uk>
  32.     Dave Beyerl <att!ihlpl!db21>
  33.     Lee Sailer <UH2@psuvm.psu.edu>
  34.     David Gast <gast@cs.ucla.edu>
  35.  
  36.     ///////////
  37.     / legenda /
  38.     ///////////
  39.  
  40.     default values          : 1
  41.     <*>                     : `*' must not be taken literally
  42.     [*]                     : `*' is optional
  43.     ^X                      : <ctrl>X
  44.     <sp>                    : space
  45.     <cr>                    : carriage return
  46.     <lf>                    : linefeed
  47.     <ht>                    : horizontal tab
  48.     <esc>                   : escape
  49.     <erase>                 : your erase character
  50.     <kill>                  : your kill character
  51.     <intr>                  : your interrupt character
  52.     <a-z>                   : an element in the range
  53.     N                       : number (`*' = allowed, `-' = not appropriate)
  54.     CHAR                    : char unequal to <ht>|<sp>
  55.     WORD                    : word followed by <ht>|<sp>|<lf>
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.     /////////////////
  63.     / move commands /
  64.     /////////////////
  65.  
  66.      N | Command            | Meaning
  67.     ---+--------------------+-----------------------------------------------
  68.      * | h | ^H | <erase>   | <*> chars to the left.
  69.      * | j | <lf> | ^N      | <*> lines downward.
  70.      * | l | <sp>           | <*> chars to the right.
  71.      * | k | ^P             | <*> lines upward.
  72.      * | $                  | To the end of line <*> from the cursor.
  73.      - | ^                  | To the first CHAR of the line.
  74.      * | _                  | To the first CHAR <*> - 1 lines lower.
  75.      * | -                  | To the first CHAR <*> lines higher.
  76.      * | + | <cr>           | To the first CHAR <*> lines lower.
  77.      - | 0                  | To the first char of the line.
  78.      * | |                  | To column <*> (<ht>: only to the endpoint).
  79.      * | f<char>            | <*> <char>s to the right (find).
  80.      * | t<char>            | Till before <*> <char>s to the right.
  81.      * | F<char>            | <*> <char>s to the left.
  82.      * | T<char>            | Till after <*> <char>s to the left.
  83.      * | ;                  | Repeat latest `f'|`t'|`F'|`T' <*> times.
  84.      * | ,                  | Idem in opposite direction.
  85.      * | w                  | <*> words forward.
  86.      * | W                  | <*> WORDS forward.
  87.      * | b                  | <*> words backward.
  88.      * | B                  | <*> WORDS backward.
  89.      * | e                  | To the end of word <*> forward.
  90.      * | E                  | To the end of WORD <*> forward.
  91.      * | G                  | Go to line <*> (default EOF).
  92.      * | H                  | To line <*> from top of the screen (home).
  93.      * | L                  | To line <*> from bottom of the screen (last).
  94.      - | M                  | To the middle line of the screen.
  95.      * | )                  | <*> sentences forward.
  96.      * | (                  | <*> sentences backward.
  97.      * | }                  | <*> paragraphs forward.
  98.      * | {                  | <*> paragraphs backward.
  99.      - | ]]                 | To the next section (default EOF).
  100.      - | [[                 | To the previous section (default begin of file).
  101.      - | `<a-z>             | To the mark.
  102.      - | '<a-z>             | To the first CHAR of the line with the mark.
  103.      - | ``                 | To the cursor position before the latest absolute
  104.                             |   jump (of which are examples `/' and `G').
  105.      - | ''                 | To the first CHAR of the line on which the cursor
  106.                             |   was placed before the latest absolute jump.
  107.      - | /<string>          | To the next occurrence of <string>.
  108.      - | ?<string>          | To the previous occurrence of <string>.
  109.      - | n                  | Repeat latest `/'|`?' (next).
  110.      - | N                  | Idem in opposite direction.
  111.      - | %                  | Find the next bracket and go to its match
  112.                             |   (also with `{'|`}' and `['|`]').
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.     /////////////////////////
  120.     / searching (see above) /
  121.     /////////////////////////
  122.  
  123.     :ta <name>              | Search in the tags file[s] where <name> is
  124.                             |   defined (file, line), and go to it.
  125.     ^]                      | Use the name under the cursor in a `:ta' command.
  126.     ^T                      | Pop the previous tag off the tagstack and return
  127.                             |   to its position.
  128.     :[x,y]g/<string>/<cmd>  | Search globally [from line x to y] for <string>
  129.                             |   and execute the `ex' <cmd> on each occurrence.
  130.     :[x,y]v/<string>/<cmd>  | Execute <cmd> on the lines that don't match.
  131.  
  132.     ///////////////////
  133.     / undoing changes /
  134.     ///////////////////
  135.  
  136.     u                       | Undo the latest change.
  137.     U                       | Undo all changes on a line, while not having
  138.                             |   moved off it (unfortunately).
  139.     :q!                     | Quit vi without writing.
  140.     :e!                     | Re-edit a messed-up file.
  141.  
  142.     ///////////////////////////////////
  143.     / appending text (end with <esc>) /
  144.     ///////////////////////////////////
  145.  
  146.      * | a                  | <*> times after the cursor.
  147.      * | A                  | <*> times at the end of line.
  148.      * | i                  | <*> times before the cursor (insert).
  149.      * | I                  | <*> times before the first CHAR of the line
  150.      * | o                  | On a new line below the current (open).
  151.                             |   The count is only useful on a slow terminal.
  152.      * | O                  | On a new line above the current.
  153.                             |   The count is only useful on a slow terminal.
  154.      * | ><move>            | Shift the lines described by <*><move> one
  155.                             |   shiftwidth to the right.
  156.      * | >>                 | Shift <*> lines one shiftwidth to the right.
  157.      * | ["<a-zA-Z1-9>]p    | Put the contents of the (default undo) buffer
  158.                             |   <*> times after the cursor.
  159.                             |   A buffer containing lines is put only once,
  160.                             |   below the current line.
  161.      * | ["<a-zA-Z1-9>]P    | Put the contents of the (default undo) buffer
  162.                             |   <*> times before the cursor.
  163.                             |   A buffer containing lines is put only once,
  164.                             |   above the current line.
  165.      * | .                  | Repeat previous command <*> times.  If the last
  166.                             |   command before a `.' command references a
  167.                             |   numbered buffer, the buffer number is
  168.                             |   incremented first (and the count is ignored):
  169.                             |
  170.                             |   "1pu.u.u.u.u      - `walk through' buffers 1
  171.                             |                       through 5
  172.                             |   "1P....           - restore them
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.     /////////////////
  180.     / deleting text /
  181.     /////////////////
  182.  
  183.     Everything deleted can be stored into a buffer. This is achieved by
  184.     putting a `"' and a letter <a-z> before the delete command. The
  185.     deleted text will be in the buffer with the used letter. If <A-Z>
  186.     is used as buffer name, the conjugate buffer <a-z> will be augmented
  187.     instead of overwritten with the text. The undo buffer always
  188.     contains the latest change. Buffers <1-9> contain the latest 9
  189.     LINE deletions (`"1' is most recent).
  190.  
  191.      * | x                  | Delete <*> chars under and after the cursor.
  192.      * | X                  | <*> chars before the cursor.
  193.      * | d<move>            | From begin to endpoint of <*><move>.
  194.      * | dd                 | <*> lines.
  195.      - | D                  | The rest of the line.
  196.      * | <<move>            | Shift the lines described by <*><move> one
  197.                             |   shiftwidth to the left.
  198.      * | <<                 | Shift <*> lines one shiftwidth to the left.
  199.      * | .                  | Repeat latest command <*> times.
  200.  
  201.     //////////////////////////////////
  202.     / changing text (end with <esc>) /
  203.     //////////////////////////////////
  204.  
  205.      * | r<char>            | Replace <*> chars by <char> - no <esc>.
  206.      * | R                  | Overwrite the rest of the line,
  207.                             |   appending change <*> - 1 times.
  208.      * | s                  | Substitute <*> chars.
  209.      * | S                  | <*> lines.
  210.      * | c<move>            | Change from begin to endpoint of <*><move>.
  211.      * | cc                 | <*> lines.
  212.      * | C                  | The rest of the line and <*> - 1 next lines.
  213.      * | =<move>            | If the option `lisp' is set, this command
  214.                             |   will realign the lines described by <*><move>
  215.                             |   as though they had been typed with the option
  216.                             |   `ai' set too.
  217.      - | ~                  | Switch lower and upper cases
  218.                             |   (should be an operator, like `c').
  219.      * | J                  | Join <*> lines (default 2).
  220.      * | .                  | Repeat latest command <*> times (`J' only once).
  221.      - | &                  | Repeat latest `ex' substitute command, e.g.
  222.                             |   `:s/wrong/good'.
  223.      - | :[x,y]s/<p>/<r>/<f>| Substitute (on lines x through y) the pattern <p>
  224.                             |   (default the last pattern) with <r>.  Useful
  225.                             |   flags <f> are `g' for `global' (i.e. change
  226.                             |   every non-overlapping occurrence of <p>) and
  227.                             |   `c' for `confirm' (type `y' to confirm a
  228.                             |   particular substitution, else <cr>).  Instead
  229.                             |   of `/' any punctuation CHAR unequal to <lf>
  230.                             |   can be used as delimiter.
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.     ///////////////////////////////////
  238.     / substitute replacement patterns /
  239.     ///////////////////////////////////
  240.  
  241.     The basic meta-characters for the replacement pattern are `&' and `~';
  242.     these are given as `\&' and `\~' when nomagic is set.  Each instance
  243.     of `&' is replaced by the characters which the regular expression
  244.     matched.  The meta-character `~' stands, in the replacement
  245.     pattern, for the defining text of the previous replacement
  246.     pattern.  Other meta-sequences possible in the replacement pattern
  247.     are always introduced by the escaping character `\'.  The sequence
  248.     `\n' (with `n' in [1-9]) is replaced by the text matched by the
  249.     n-th regular subexpression enclosed between `\(' and `\)'.  The
  250.     sequences `\u' and `\l' cause the immediately following character
  251.     in the replacement to be converted to upper- or lower-case
  252.     respectively if this character is a letter.  The sequences `\U' and
  253.     `\L' turn such conversion on, either until `\E' or `\e' is
  254.     encountered, or until the end of the replacement pattern.
  255.  
  256.     //////////////////////////////
  257.     / remembering text (yanking) /
  258.     //////////////////////////////
  259.  
  260.     With yank commands you can put `"<a-zA-Z>' before the command, just as
  261.     with delete commands.  Otherwise you only copy to the undo buffer.
  262.     The use of buffers <a-z> is THE way of copying text to another file;
  263.     see the `:e <file>' command.
  264.  
  265.      * | y<move>            | Yank from begin to endpoint of <*><move>.
  266.      * | yy                 | <*> lines.
  267.      * | Y                  | Idem (should be equivalent to `y$' though).
  268.      - | m<a-z>             | Mark the cursor position with a letter.
  269.  
  270.     ////////////////////////////////////////
  271.     / commands while in append|change mode /
  272.     ////////////////////////////////////////
  273.  
  274.     ^@                      | If typed as the first character of the
  275.                             |   insertion, it is replaced with the previous
  276.                             |   text inserted (max. 128 chars), after which
  277.                             |   the insertion is terminated.
  278.     ^V                      | Deprive the next char of its special meaning
  279.                             |   (e.g. <esc>).
  280.     ^D                      | One shiftwidth to the left, but only if
  281.                             |   nothing else has been typed on the line.
  282.     0^D                     | Remove all indentation on the current line
  283.                             |   (there must be no other chars on the line).
  284.     ^^D                     | Idem, but it is restored on the next line.
  285.     ^T                      | One shiftwidth to the right, but only if
  286.                             |   nothing else has been typed on the line.
  287.     ^H | <erase>            | One char back.
  288.     ^W                      | One word back.
  289.     <kill>                  | Back to the begin of the change on the
  290.                             |   current line.
  291.     <intr>                  | Like <esc> (but you get a beep as well).
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.     /////////////////////////////////////////////////
  299.     / writing, editing other files, and quitting vi /
  300.     /////////////////////////////////////////////////
  301.  
  302.     In `:' `ex' commands - if not the first CHAR on the line - `%' denotes
  303.     the current file, `#' is a synonym for the alternate file (which
  304.     normally is the previous file).  As first CHAR on the line `%' is a
  305.     shorthand for `1,$'.  Marks can be used for line numbers too: '<a-z>.
  306.     In the `:w'|`:f'|`:cd'|`:e'|`:n' commands shell meta-characters can be
  307.     used.
  308.  
  309.     :q                      | Quit vi, unless the buffer has been changed.
  310.     :q!                     | Quit vi without writing.
  311.     ^Z                      | Suspend vi.
  312.     :w                      | Write the file.
  313.     :w <name>               | Write to the file <name>.
  314.     :w >> <name>            | Append the buffer to the file <name>.
  315.     :w! <name>              | Overwrite the file <name>.
  316.     :x,y w <name>           | Write lines x through y to the file <name>.
  317.     :wq                     | Write the file and quit vi; some versions quit
  318.                             |   even if the write was unsuccessful!
  319.                             |   Use `ZZ' instead.
  320.     ZZ                      | Write if the buffer has been changed, and
  321.                             |   quit vi.  If you have invoked vi with the `-r'
  322.                             |   option, you'd better write the file
  323.                             |   explicitly (`w' or `w!'), or quit the
  324.                             |   editor explicitly (`q!') if you don't want
  325.                             |   to overwrite the file - some versions of vi
  326.                             |   don't handle the `recover' option very well.
  327.     :x [<file>]             | Idem [but write to <file>].
  328.     :x! [<file>]            | `:w![<file>]' and `:q'.
  329.     :pre                    | Preserve the file - the buffer is saved as if
  330.                             |   the system had just crashed; for emergencies,
  331.                             |   when a `:w' command has failed and you don't
  332.                             |   know how to save your work (see `vi -r').
  333.     :f <name>               | Set the current filename to <name>.
  334.     :cd [<dir>]             | Set the working directory to <dir>
  335.                             |   (default home directory).
  336.     :cd! [<dir>]            | Idem, but don't save changes.
  337.     :e [+<cmd>] <file>      | Edit another file without quitting vi - the
  338.                             |   buffers are not changed (except the undo
  339.                             |   buffer), so text can be copied from one file to
  340.                             |   another this way.  [Execute the `ex' command
  341.                             |   <cmd> (default `$') when the new file has been
  342.                             |   read into the buffer.]  <cmd> must contain no
  343.                             |   <sp> or <ht>.  See `vi startup'.
  344.     :e! [+<cmd>] <file>     | Idem, without writing the current buffer.
  345.     ^^                      | Edit the alternate (normally the previous) file.
  346.     :rew                    | Rewind the argument list, edit the first file.
  347.     :rew!                   | Idem, without writing the current buffer.
  348.     :n [+<cmd>] [<files>]   | Edit next file or specify a new argument list.
  349.     :n! [+<cmd>] [<files>]  | Idem, without writing the current buffer.
  350.     :args                   | Give the argument list, with the current file
  351.                             |   between `[' and `]'.
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.     ////////////////////
  359.     / display commands /
  360.     ////////////////////
  361.  
  362.     ^G                      | Give file name, status, current line number
  363.                             |   and relative position.
  364.     ^L                      | Refresh the screen (sometimes `^P' or `^R').
  365.     ^R                      | Sometimes vi replaces a deleted line by a `@',
  366.                             |   to be deleted by `^R' (see option `redraw').
  367.     [*]^E                   | Expose <*> more lines at bottom, cursor
  368.                             |   stays put (if possible).
  369.     [*]^Y                   | Expose <*> more lines at top, cursor
  370.                             |   stays put (if possible).
  371.     [*]^D                   | Scroll <*> lines downward
  372.                             |   (default the number of the previous scroll;
  373.                             |   initialization: half a page).
  374.     [*]^U                   | Scroll <*> lines upward
  375.                             |   (default the number of the previous scroll;
  376.                             |   initialization: half a page).
  377.     [*]^F                   | <*> pages forward.
  378.     [*]^B                   | <*> pages backward (in older versions `^B' only
  379.                             |   works without count).
  380.  
  381.     If in the next commands the field <wi> is present, the windowsize
  382.     will change to <wi>. The window will always be displayed at the
  383.     bottom of the screen.
  384.  
  385.     [*]z[wi]<cr>            | Put line <*> at the top of the window
  386.                             |   (default the current line).
  387.     [*]z[wi]+               | Put line <*> at the top of the window
  388.                             |   (default the first line of the next page).
  389.     [*]z[wi]-               | Put line <*> at the bottom of the window
  390.                             |   (default the current line).
  391.     [*]z[wi]^               | Put line <*> at the bottom of the window
  392.                             |   (default the last line of the previous page).
  393.     [*]z[wi].               | Put line <*> in the centre of the window
  394.                             |   (default the current line).
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.     ////////////////////////////
  402.     / mapping and abbreviation /
  403.     ////////////////////////////
  404.  
  405.     When mapping take a look at the options `to' and `remap' (below).
  406.  
  407.     :map <string> <seq>     | <string> is interpreted as <seq>, e.g.
  408.                             |   `:map ^C :!cc %^V<cr>' to invoke `cc' (the C
  409.                             |   compiler) from within the editor
  410.                             |   (vi replaces `%' with the current file name).
  411.     :map                    | Show all mappings.
  412.     :unmap <string>         | Deprive <string> of its mapping.  When vi
  413.                             |   complains about non-mapped macros (whereas no
  414.                             |   typos have been made), first do something like
  415.                             |   `:map <string> Z', followed by
  416.                             |   `:unmap <string>' (`Z' must not be a macro
  417.                             |   itself), or switch to `ex' mode first with `Q'.
  418.     :map! <string> <seq>    | Mapping in append mode, e.g.
  419.                             |   `:map! \be begin^V<cr>end;^V<esc>O<ht>'.
  420.                             |   When in append mode <string> is preceded by
  421.                             |   `^V', no mapping is done.
  422.     :map!                   | Show all append mode mappings.
  423.     :unmap! <string>        | Deprive <string> of its mapping (see `:unmap').
  424.     :ab <string> <seq>      | Whenever in append mode <string> is preceded and
  425.                             |   followed by a breakpoint (e.g. <sp> or `,'), it
  426.                             |   is interpreted as <seq>, e.g.
  427.                             |   `:ab ^P procedure'.  A `^V' immediately
  428.                             |   following <string> inhibits expansion.
  429.     :ab                     | Show all abbreviations.
  430.     :unab <string>          | Do not consider <string> an abbreviation
  431.                             |   anymore (see `:unmap').
  432.     @<a-z>                  | Consider the contents of the named register a
  433.                             |   command, e.g.:
  434.                             |       o0^D:s/wrong/good/<esc>"zdd
  435.                             |   Explanation:
  436.                             |       o              - open a new line
  437.                             |       0^D            - remove indentation
  438.                             |       :s/wrong/good/ - this input text is an
  439.                             |                        `ex' substitute command
  440.                             |       <esc>          - finish the input
  441.                             |       "zdd           - delete the line just
  442.                             |                        created into register `z'
  443.                             |   Now you can type `@z' to replace `wrong'
  444.                             |   with `good' on the current line.
  445.     @@                      | Repeat last register command.
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.     /////////////////////////////
  453.     / switch and shell commands /
  454.     /////////////////////////////
  455.  
  456.     Q | ^\ | <intr><intr>   | Switch from vi to `ex'.
  457.     :                       | An `ex' command can be given.
  458.     :vi                     | Switch from `ex' to vi.
  459.     :sh                     | Execute a subshell, back to vi by `^D'.
  460.     :[x,y]!<cmd>            | Execute a shell <cmd> [on lines x through y;
  461.                             |   these lines will serve as input for <cmd> and
  462.                             |   will be replaced by its standard output].
  463.     :[x,y]!! [<args>]       | Repeat last shell command [and append <args>].
  464.     :[x,y]!<cmd> ! [<args>] | Use the previous command (the second `!') in a
  465.                             |   new command.
  466.     [*]!<move><cmd>         | The shell executes <cmd>, with as standard
  467.                             |   input the lines described by <*><move>,
  468.                             |   next the standard output replaces those lines
  469.                             |   (think of `cb', `sort', `nroff', etc.).
  470.     [*]!<move>!<args>       | Append <args> to the last <cmd> and execute it,
  471.                             |   using the lines described by the current
  472.                             |   <*><move>.
  473.     [*]!!<cmd>              | Give <*> lines as standard input to the
  474.                             |   shell <cmd>, next let the standard output
  475.                             |   replace those lines.
  476.     [*]!!! [<args>]         | Use the previous <cmd> [and append <args> to it].
  477.     :x,y w !<cmd>           | Let lines x to y be standard input for <cmd>
  478.                             |   (notice the <sp> between the `w' and the `!').
  479.     :r!<cmd>                | Put the output of <cmd> onto a new line.
  480.     :r <name>               | Read the file <name> into the buffer.
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.     //////////////
  488.     / vi startup /
  489.     //////////////
  490.  
  491.     vi [<files>]            | Edit the files, start with the first page of
  492.                             |   the first file.
  493.  
  494.     The editor can be initialized by the shell variable `EXINIT', which
  495.     looks like:
  496.  
  497.             EXINIT='<cmd>|<cmd>|...'
  498.             <cmd>: set options
  499.                    map ...
  500.                    ab ...
  501.             export EXINIT (in the Bourne shell)
  502.  
  503.     However, the list of initializations can also be put into a file.
  504.     If this file is located in your home directory, and is named `.exrc'
  505.     AND the variable `EXINIT' is NOT set, the list will be executed
  506.     automatically at startup time. However, vi will always execute the
  507.     contents of a `.exrc' in the current directory, if you own the file.
  508.     Else you have to give the execute (`source') command yourself:
  509.  
  510.             :so file
  511.  
  512.     In a `.exrc' file a comment is introduced with a double quote character:
  513.     the rest of the line is ignored.  Exception: if the last command on the
  514.     line is a `map[!]' or `ab' command or a shell escape, a trailing comment
  515.     is not recognized, but considered part of the command.
  516.  
  517.     On-line initializations can be given with `vi +<cmd> file', e.g.:
  518.  
  519.     vi +x file              | The cursor will immediately jump to line x
  520.                             |   (default last line).
  521.     vi +/<string> file      | Jump to the first occurrence of <string>.
  522.  
  523.     You can start at a particular tag with:
  524.  
  525.     vi -t <tag>             | Start in the right file in the right place.
  526.  
  527.     Sometimes (e.g. if the system crashed while you were editing) it is
  528.     possible to recover files lost in the editor by `vi -r file'.  A plain
  529.     `vi -r' command shows the files you can recover.
  530.     If you just want to view a file by using vi, and you want to avoid any
  531.     change, instead of vi you can use the `view' or `vi -R' command:
  532.     the option `readonly' will be set automatically (with `:w!' you can
  533.     override this option).
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.     //////////////////////////////
  541.     / the most important options /
  542.     //////////////////////////////
  543.  
  544.     ai                      | autoindent - In append mode after a <cr> the
  545.                             |   cursor will move directly below the first
  546.                             |   CHAR on the previous line.  However, if the
  547.                             |   option `lisp' is set, the cursor will align
  548.                             |   at the first argument to the last open list.
  549.     aw                      | autowrite - Write at every shell escape
  550.                             |   (useful when compiling from within vi).
  551.     dir=<string>            | directory - The directory for vi to make
  552.                             |   temporary files (default `/tmp').
  553.     eb                      | errorbells - Beeps when you goof
  554.                             |   (not on every terminal).
  555.     ic                      | ignorecase - No distinction between upper and
  556.                             |   lower cases when searching.
  557.     lisp                    | Redefine the following commands:
  558.                             |   `(', `)'   - move backward (forward) over
  559.                             |                S-expressions
  560.                             |   `{', `}'   - idem, but don't stop at atoms
  561.                             |   `[[', `]]' - go to previous (next) line
  562.                             |                beginning with a `('
  563.                             |   See option `ai'.
  564.     list                    | <lf> is shown as `$', <ht> as `^I'.
  565.     magic                   | If this option is set (default), the chars `.',
  566.                             |   `[' and `*' have special meanings within search
  567.                             |   and `ex' substitute commands.  To deprive such
  568.                             |   a char of its special function it must be
  569.                             |   preceded by a `\'.  If the option is turned off
  570.                             |   it's just the other way around.  Meta-chars:
  571.                             |   ^<string>    - <string> must begin the line
  572.                             |   <string>$    - <string> must end the line
  573.                             |   .            - matches any char
  574.                             |   [a-z]        - matches any char in the range
  575.                             |   [^a-z]       - any char not in the range
  576.                             |   [<string>]   - matches any char in <string>
  577.                             |   [^<string>]  - any char not in <string>
  578.                             |   <char>*      - 0 or more <char>s
  579.                             |   \<<string>   - <string> must begin a word
  580.                             |   <string>\>   - <string> must end a word
  581.     modeline                | When you read an existing file into the buffer,
  582.                             |   and this option is set, the first and last 5
  583.                             |   lines are checked for editing commands in the
  584.                             |   following form:
  585.                             |
  586.                             |     <sp>vi:set options|map ...|ab ...|!...:
  587.                             |
  588.                             |   Instead of <sp> a <ht> can be used, instead of
  589.                             |   `vi' there can be `ex'.  Warning: this option
  590.                             |   could have nasty results if you edit a file
  591.                             |   containing `strange' modelines.
  592.     nu                      | number - Numbers before the lines.
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.     para=<string>           | paragraphs - Every pair of chars in <string> is
  600.                             |   considered a paragraph delimiter nroff macro
  601.                             |   (for `{' and `}').  A <sp> preceded by a `\'
  602.                             |   indicates the previous char is a single letter
  603.                             |   macro.  `:set para=P\ bp' introduces `.P' and
  604.                             |   `.bp' as paragraph delimiters.  Empty lines and
  605.                             |   section boundaries are paragraph boundaries
  606.                             |   too.
  607.     redraw                  | The screen remains up to date.
  608.     remap                   | If on (default), macros are repeatedly
  609.                             |   expanded until they are unchanged.
  610.                             |   Example: if `o' is mapped to `A', and `A'
  611.                             |   is mapped to `I', then `o' will map to `I'
  612.                             |   if `remap' is set, else it will map to `A'.
  613.     report=<*>              | Vi reports whenever e.g. a delete
  614.                             |   or yank command affects <*> or more lines.
  615.     ro                      | readonly - The file is not to be changed.
  616.                             |   However, `:w!' will override this option.
  617.     sect=<string>           | sections - Gives the section delimiters (for `[['
  618.                             |   and `]]'); see option `para'. A `{' beginning a
  619.                             |   line also starts a section (as in C functions).
  620.     sh=<string>             | shell - The program to be used for shell escapes
  621.                             |   (default `$SHELL' (default `/bin/sh')).
  622.     sw=<*>                  | shiftwidth - Gives the shiftwidth (default 8
  623.                             |   positions).
  624.     sm                      | showmatch - Whenever you append a `)', vi shows
  625.                             |   its match if it's on the same page; also with
  626.                             |   `{' and `}'.  If there's no match at all, vi
  627.                             |   will beep.
  628.     taglength=<*>           | The number of significant characters in tags
  629.                             |   (0 = unlimited).
  630.     tags=<string>           | The space-separated list of tags files.
  631.     terse                   | Short error messages.
  632.     to                      | timeout - If this option is set, append mode
  633.                             |   mappings will be interpreted only if they're
  634.                             |   typed fast enough.
  635.     ts=<*>                  | tabstop - The length of a <ht>; warning: this is
  636.                             |   only IN the editor, outside of it <ht>s have
  637.                             |   their normal length (default 8 positions).
  638.     wa                      | writeany - No checks when writing (dangerous).
  639.     warn                    | Warn you when you try to quit without writing.
  640.     wi=<*>                  | window - The default number of lines vi shows.
  641.     wm=<*>                  | wrapmargin - In append mode vi automatically
  642.                             |   puts a <lf> whenever there is a <sp> or <ht>
  643.                             |   within <wm> columns from the right margin
  644.                             |   (0 = don't put a <lf> in the file, yet put it
  645.                             |   on the screen).
  646.     ws                      | wrapscan - When searching, the end is
  647.                             |   considered `stuck' to the begin of the file.
  648.  
  649.     :set <option>           | Turn <option> on.
  650.     :set no<option>         | Turn <option> off.
  651.     :set <option>=<value>   | Set <option> to <value>.
  652.     :set                    | Show all non-default options and their values.
  653.     :set <option>?          | Show <option>'s value.
  654.     :set all                | Show all options and their values.
  655.