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