home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / vile-os2.zip / vile.hlp < prev    next >
Text File  |  1998-10-02  |  165KB  |  3,899 lines

  1.  
  2. Getting along with vile                        (version 8.1)
  3. -----------------------                        -------------
  4.  
  5.     Use Ctrl-D and Ctrl-U to scroll through this help information.
  6.  
  7.     Type Ctrl-O to make this the only window on the screen.
  8.     Type Ctrl-K to get rid of this window.
  9.  
  10.     First, to leave vile, use any of the following:
  11.         :q
  12.         :quit
  13.         :exit
  14.         :wq    (writes current buffer before quitting)
  15.         :q!    (quits without writing any changes!)
  16.         Q
  17.         :wwq or ZZ    (will write all changed buffers)
  18.         ^X-^C    (don't know why.  _They_ don't put in ":q" for _us_!
  19.              Actually, if ^C is your interrupt character, this
  20.              won't get you out of vile.)
  21.  
  22.     To get help (probably just this text), use any of:
  23.         :h
  24.         :help
  25.         ^X-h
  26.         ^A-h
  27.  
  28.     The only vile commands described herein are those not present in
  29.     vi, or differing greatly from those in vi.  There is a section at
  30.     the bottom describing other differences between vile and vi.
  31.  
  32.     To get a complete list of all commands, type ":show-commands".  To
  33.     get a list of all commands that contain the string "name", type
  34.     ":apropos name".  These lists will show all command synonyms and
  35.     key sequences that are bound to the same function, along with a
  36.     short description of the command, and whether it is a motion or
  37.     operator command.
  38.  
  39.     To get information on a specific key-binding or function, use the
  40.     "describe-key" or "describe-function" commands.  You will be asked
  41.     for a keystroke or function name, and a short description will be
  42.     shown.
  43.  
  44.     You needn't type full command names -- type a few characters and
  45.     hit TAB to perform command completion.  Hitting a second TAB will
  46.     pop up a window containing the list of possible completions.
  47.  
  48.     If your screen hops around a lot when you scroll, see the "Note on
  49.     Scrolling" section near the bottom of this file.
  50.  
  51. General Remarks
  52. ---------------
  53.  
  54.     vile holds text in "buffers".  Usually, these correspond to a file
  55.     that you are editing, but not always.  For instance, a buffer
  56.     might be used to display this help text, or to hold the output
  57.     of a shell command that you have run.  Buffers have names, and
  58.     these usually match the names of the files they contain.
  59.  
  60.     Buffers are sometimes displayed in windows.  A buffer may be
  61.     displayed in more than one window at the same time.  There is
  62.     no such thing as a hidden window.  All existing windows are on
  63.     the screen.  There may, however, be hidden buffers, which are not
  64.     currently associated with any window.
  65.  
  66.     All yank/delete registers (the default unnamed register, the numbered
  67.     registers ("1-"9) that hold line-deletes, and the named registers
  68.     ("a-"z)) are global to the editor, and not attached to any single
  69.     buffer.  Thus you can delete text in one buffer and put it back in
  70.     another.
  71.  
  72.     Undo operations are attached to a buffer, not a window.  Thus if
  73.     you have two windows to the same buffer, and make a change in one,
  74.     you can undo it in the other.
  75.  
  76.     vile is 8-bit clean, allowing it to be used more easily at non-
  77.     English speaking sites.  See the section on "8-Bit Operation" for
  78.     more information.
  79.  
  80. Command Prefixes
  81. ----------------
  82.  
  83.     To extend the vi command set in vile, two (or three, depending on
  84.     how you count them) command "prefixes" exist.  These keystrokes,
  85.     in combination with another key, can be bound as a pair to execute
  86.     any vile function.  The default values for these prefixes are
  87.         Key:            Bound to dummy function:
  88.         ^X     Control-X     cntl_x-prefix
  89.         ^A     Control-A     cntl_a-prefix
  90.         #      poundsign    function-prefix
  91.     If you find any of these keys hard to type, or would prefer that
  92.     they are all control characters (or all non-control), they can
  93.     be changed by binding a new key to the function listed above.  See
  94.     the section on "Key Rebinding" below.  If you do change the values
  95.     of these keys, most of vile's informational displays (the Binding
  96.     List, for instance) will reflect these changes.  This documentation,
  97.     of course, will not change.
  98.  
  99.     (The '#' key is used in vi to give terminal independent access
  100.     to function key bindings.  This is also true in vile -- if something
  101.     is bound to '#2', then it is also probably available with key F2
  102.     on your keyboard.)
  103.  
  104. Buffer manipulation commands:
  105. -----------------------------
  106.  
  107.     vile stores buffers in a sorted list.  Depending on the
  108.     setting of the "autobuffer" mode, this list is either sorted
  109.     in "most-recently-used" order (this is the vile default), or in a
  110.     fixed order dependent on the order of editing (this is how vi
  111.     normally does it, and can be attained by turning "autobuffer"
  112.     off, with "set noautobuffer").
  113.  
  114.     _    Show a list of the first 9 buffers.  Follow this command
  115.         with a digit to select that buffer, or simply repeat it
  116.         ("__") to select the buffer most-recently visited.  In
  117.         autobuffer mode, this is identical to "_1".  If autobuffer
  118.         mode is off, the buffer which will be visited with "__" is
  119.         flagged with a '#' character in the list.  Modified buffers
  120.         are preceded by a '*' in the history list.  There are many
  121.         different ways to get the previous file:
  122.             __
  123.             _1    (autobuffer mode on)
  124.             1_    (    "       "    ")
  125.             :e#
  126.             ^^   (ctrl-^)  (but many keyboards can't produce this)
  127.  
  128.         The buffer number may also precede the '_' command.  This is
  129.         necessary when visiting buffers numbered higher than '9'.  For
  130.         example, one would type "13_" to visit buffer 13 in the list.
  131.  
  132.         [ See the note under "Differences", below, for comments on
  133.         vi's use of '_'.]
  134.  
  135.     :e    Edit a file.  If the file is already in a buffer, that buffer
  136.         will be recalled into the current window.  This occurs as
  137.         follows: If the name given contains no path delimiters
  138.         (i.e. slashes), then it will be compared to the existing
  139.         vile buffer names.  Failing that comparison (or if there
  140.         are any slashes in the name), the name will be stretched
  141.         into an absolute path, and will be compared to the existing
  142.         buffers' filenames.  In either case, the matching buffer
  143.         will be chosen.  If there are no such matches, the file
  144.         will be fetched from the filesystem.  This matching
  145.         technique introduces an ambiguity, since buffer names are
  146.         created from the last path component of filenames.  To
  147.         force vile to edit a file from the current directory whose
  148.         basename matches that of one that was edited elsewhere,
  149.         simply preface the name with "./".  For example, if you
  150.         edit "../Makefile" and later attempt to edit "Makefile",
  151.         vile will assume you are referring to the _buffer_ named
  152.         "Makefile".  To get the file in the current directory,
  153.         specify "./Makefile".
  154.  
  155.     :e!    Re-edit a file.  A different filename can be given, and the
  156.         buffer name will change to match it.  This command is not as
  157.         necessary in vile as it is in vi, since multiple buffers may
  158.         have outstanding unwritten changes.
  159.  
  160.     :n    Go to the next buffer.  "Next" means "least recently used"
  161.         in autobuffer mode.  In noautobuffer mode, "next" means
  162.         next in numeric sequence.  (The ":n file ..." version of
  163.         the command is not supported.)
  164.  
  165.     :rename-buffer   Rename the current buffer.  Prompts for a new name.
  166.         Does not affect the filename associated with the buffer.
  167.         Use ":f" to do that.  This command is useful for renaming
  168.         the "[Output]" buffer, if you wish to preserve its
  169.         contents, but run a new command.
  170.  
  171.     :rewind    Go to the first buffer.  This is used only in 'noautobuffer'
  172.         (vi-style buffering) mode.  It does nothing in "autobuffer"
  173.         mode.  Remember that "autobuffer" mode is the default.
  174.  
  175.     :b    Edit a buffer.  Recalls the named buffer.  Does not look for
  176.         a file of that name.  Will find "invisible" buffers.
  177.  
  178.     :ki    Kill a buffer.  Remove the buffer and its contents from the
  179.         editor.  Will ask if changes to the buffer should be
  180.         discarded.
  181.  
  182.     ^X-e    Edit the file whose pathname appears under the cursor.  For
  183.         example, if you are editing a makefile, you could edit one
  184.         of the source files by placing the cursor at the start of
  185.         its name and using this command.  Note that this does not
  186.         know about some characters that your shell might usually
  187.         translate for you, like the '$' in '$HOME'.
  188.  
  189.     ^X-k    Kill the buffer whose name or filename appears under the
  190.         cursor.
  191.  
  192.     *    Display a list of all buffers, or make that display go away
  193.         if it's already present.  Leave your finger on the key, and
  194.         it's easy to create and destroy the list.  The buffers are
  195.         numbered; the numbers correspond to the history numbers
  196.         shown and used by the '_' command, described above.  (If
  197.         the buffer number is greater than 9, then the "nn_" form of
  198.         the '_' command must be used, since '_' will only accept a
  199.         single following digit.)  The order of the list is either
  200.         most-recently-used, or fixed, depending on the setting
  201.         of "autobuffer" mode (see below).  vile attempts to keep
  202.         the contents of the buffer list window up to date if it
  203.         is left up on the screen while other buffer manipulation
  204.         commands are given.
  205.  
  206.     ^A-*    Always display a list of all buffers.  Useful for updating the
  207.         list if it's already on the screen but may be out of date.
  208.         Any argument will cause the list to include _all_ buffers,
  209.         even those normally considered "invisible".  (For example,
  210.         macros are stored in "invisible" buffers.)  [This command
  211.         isn't as necessary now that the buffer list is maintained
  212.         dynamically...]
  213.  
  214. Window manipulation commands:
  215. -----------------------------
  216.  
  217.     ^X-2    Make Two windows.  Splits the current window in half. This
  218.         is the usual way to create a new window.
  219.     ^K or ^X-0    Get rid of (Kill) this window.
  220.     ^O or ^X-1    Make this the Only window on the screen.
  221.  
  222.     ^X-o    Move to the next window.
  223.     ^X-O    Move to the previous window.
  224.  
  225.     v    Make the current window smaller.
  226.     V    Make the current window larger.
  227.  
  228.     ^A-^D    Scroll the next window down half a screen.
  229.     ^A-^U    Scroll the next window up half a screen.
  230.     ^A-^E    Scroll the next window up one line.
  231.     ^A-^Y    Scroll the next window down one line.
  232.     (The previous four commands are useful when comparing two buffers.
  233.      Mnemonic -- think of them as affecting the "A"lternate window.)
  234.  
  235.     zH zM zL
  236.     zt zm zb
  237.         These are synonyms for vi's 'z+', 'z.', and 'z-', which
  238.         position the line holding the cursor at the top, middle, or
  239.         bottom of the screen, respectively.  (Any of the second
  240.         characters can be upper or lower case.)  Mnemonically, these
  241.         correspond to the H, M, and L screen positioning commands,
  242.         or to "top", "middle", or "bottom" -- take your choice.
  243.         In a macro, only the first character of the argument is
  244.         significant, but something like "position-window middle" is
  245.         most readable.  Supplying a count will offset that far
  246.         from the top or bottom of window.  (But the middle is
  247.         always the middle.)
  248.  
  249.     ^X-^R    Scroll the window right or left by 1/3 of a screen, or by the
  250.     ^X-^L    number of columns specified.  Changes the "sideways" value.
  251.         Neither of these commands will actually move the cursor
  252.         in the buffer -- they only reframe your view into the buffer.
  253.         If the cursor would be forced to move off-screen (which is
  254.         of course impossible and undesirable) as a result of the
  255.         requested sideways scroll, then nothing at all will happen.
  256.         The commands are arguably crippled as is.
  257.  
  258.     If for some reason you can't get your screen set right via a
  259.     TERM variable, try the ":screen-rows" or ":screen-columns"
  260.     commands (which take their args (number of rows or columns
  261.     respectively) before you type the ":").
  262.  
  263.     [ Personally, I put the following bindings in my .vilerc:
  264.         bind-key split-current-window ^T    ; split into 'T'wo windows
  265.         bind-key next-window ^N        ; 'N'ext window
  266.         bind-key previous-window ^P        ; 'P'revious window
  267.     Since ^K already 'K'ills a window, and ^O makes it the 'O'nly window,
  268.     these give more mnemonic, and faster, access to multiple windows.
  269.     (These would be the default, but ^N, ^P, and ^T have other meanings
  270.     in real vi (all of which have alternate bindings in vile.) ]
  271.  
  272. File manipulation commands:
  273. ---------------------------
  274.  
  275.     The usual ":e", ":r", ":f", ":w" commands are available, though
  276.     only ":e!" and ":w!" are available of the "!" options.  The ":r"
  277.     command reads the named file in after the current line.  To read a
  278.     file before the first line, use ":0r".  File completion works like
  279.     command completion: using the TAB and '?' keys you can complete or
  280.     see next character choices.  Additionally, on unix hosts, backquotes
  281.     may be used to invoke a shell command that returns the path of a
  282.     desired file.  For example:
  283.  
  284.         :e `which locks`       # csh looks for script called "locks"
  285.         :e `type -path locks`  # bash equivalent
  286.  
  287.     The commands ":ww" and ":wwq" correspond roughly to ":w" and ":wq",
  288.     but they each write all modified buffers, rather than just the
  289.     current one.  Giving any numeric argument to ":ww" (i.e. "1:ww")
  290.     will suppress the per-file and "Press return to continue" message.
  291.     This may be useful when using the command from within a macro.
  292.  
  293.     As in vi, ranges of lines specified by line numbers (including '.',
  294.     '$', and '%' shorthands) or marks may precede these commands.
  295.     Unlike vi, search patterns cannot be used as line specifiers.
  296.  
  297.     In addition, two non-"colon" commands have been added:
  298.  
  299.     ^R    Prompts for a filename, and then reads it in _above_ the
  300.         current line.  If a register is specified (e.g. "a^R ),
  301.         the file is read into that named register, but not inserted
  302.         into the current buffer.
  303.  
  304.     ^W    is a writing operator, which prompts for a filename, and
  305.         writes the specified region to that file.  Like all operators,
  306.         if the command is repeated, as in ^W^W, then lines are
  307.         affected.  Use 10^W^W to write 10 lines.
  308.  
  309.         If a register is specified (e.g. "a^W ) then the command
  310.         is _not_ an operator, but writes the specified register to
  311.         the named file.
  312.  
  313. Shell Access
  314. ------------
  315.  
  316.     Anywhere a filename is valid, a command name is also
  317.     valid, entered in the form "!shell-command".  The whole line is
  318.     handed to the shell, and the read or write operation is done on
  319.     the commands standard input or output, as appropriate.  Thus
  320.     you can type ":e !date" to edit a copy of today's date.
  321.  
  322.     The ": !cmd" shell escape works pretty much as it does in vi.
  323.     The command ":!!" will rerun the previous such shell command.
  324.  
  325.     The '!' operator works as a filter, as expected.
  326.  
  327.     In addition, the ^X-! command runs a shell command and captures
  328.     its output in a specific buffer, called "[Output]".  This is
  329.     almost identical to ":e !cmd", except that in that case the buffer
  330.     is named according to the command name.
  331.  
  332.     These "output capture" commands are most useful in conjunction with
  333.     the "error finder", '^X-^X', described below.
  334.  
  335.     Filename completion is performed on words of the shell command
  336.     in response to a TAB character.  To actually include a TAB character
  337.     in the shell command, escape it with ^V.  Command completion is
  338.     not currently implemented -- so, for instance, $PATH is not searched
  339.     for possible completions to the first word of a command line.
  340.  
  341.     On systems supporting job control, ^Z (or ":stop") will suspend vile.
  342.  
  343.     The :cd and :pwd commands are of course supported.  Unlike vi,
  344.     filenames will track their directory of origin, so you can't simply
  345.     edit a file in one directory, cd to another, and write it.  You
  346.     must explicitly write to ./filename in the new directory to
  347.     accomplish this.  ":cd -" will return to the previous directory, as
  348.     it does in some shells.  The CDPATH environment variable provides a
  349.     search path for the :cd command.
  350.  
  351.     Giving an argument to the ": !" (also called "shell-command" when
  352.     writing macros) will suppress the "Press return to continue" message
  353.     after the command runs.
  354.  
  355. Text manipulation command:
  356. --------------------------
  357.  
  358.     Remember, these are only the new or different commands.  The
  359.     standard vi set should still work.
  360.  
  361.     The vi "global" (":g") command is present.  So is the "substitute"
  362.     (":s") command.  These both look pretty different while they're
  363.     being used than they do in vi, due to the interactive nature of
  364.     the prompting.  And, since the searching is done right after the
  365.     pattern is entered, there may be a slight delay while you're trying
  366.     to finish typing your complete command.  (If the pattern does not
  367.     exist, you may not get to finish typing your command at all.)  You
  368.     can use the commands just as you would have in vi, i.e.
  369.     ":g/oldpat/s//newstring/" will work.  But you won't see any of the
  370.     '/' characters.  Try it-- you'll get the idea.  Line ranges are not
  371.     possible on ":g", but they are on ":s".
  372.  
  373.     The ":g" command can be followed by any of l (list), p (print),
  374.     < (left shift), > (right shift), r (read file), d (delete),
  375.     L (lower case), U (upper case), ~ (flip case), put (append
  376.     yanked text), Put (prepend yanked text), s (substitute),
  377.     trim (trim trailing whitespace).  For example, ":g/pattern/Put"
  378.     will insert the contents of the default yank register just
  379.     above every line containing "pattern".   The ":g" command can
  380.     only be used over the entire file -- smaller regions are not
  381.     permitted.
  382.  
  383.     The ":v" counterpart to ":g" is also implemented -- it performs the
  384.     given command on all lines that don't match the given pattern.
  385.  
  386.     The substitute command can be followed by any of 'g', a digit, or
  387.     'p', to do the substitution for all occurrences, the n'th
  388.     occurrence, or to print the resulting line respectively.  You can
  389.     also add a 'c', and you will be asked to confirm each replacement
  390.     before it occurs.  The text being replaced will be highlighted,
  391.     and you can answer with 'y', 'n', 'q', or 'a'.  'a' will suppress
  392.     further prompting, and will do the rest of the replacements.
  393.  
  394.     The ":&" and '&' commands work much as they do in vi, and repeat
  395.     the last substitution.  The '^A-&' command is a new operator (see
  396.     below), so it can work on regions: for example use '^A-&}' to
  397.     "repeat the previous substitution over the rest of this paragraph".
  398.  
  399.     Infinite Undo
  400.     --------------
  401.     The regular undo ('u') and line-undo ('U') are available for all
  402.     commands.  They are a little more predictable than their vi
  403.     counterparts, since they do not share the default yank register for
  404.     their operation.  Also, line-undo ('U') is available until the next
  405.     change anywhere in the file, rather than until you leave the line.
  406.  
  407.     vile also lets you undo all changes made to a buffer since it was
  408.     first edited (so-called "infinite undo").  The '^X-u' command will
  409.     undo changes, one by one (or given a count, several at a time).
  410.     The '^X-r' command will walk forward, redoing the previously undone
  411.     changes one by one.  A fresh change to the buffer will cause
  412.     previously undone changes to no longer be redoable.  Remember that
  413.     with key rebinding, you can change your 'u' or 'U' command to be an
  414.     infinite undo, making it easier to type.
  415.  
  416.     In addition, the '.' command, which normally re-executes the last
  417.     buffer-modifying command, has special behavior with respect to
  418.     undo.  If the '.' command immediately follows one of the undo
  419.     commands ('u', '^X-u', or '^X-r'), then it will perform another
  420.     undo or redo, as appropriate.  If there are any intervening commands,
  421.     then '.' will re-execute the last command prior to the undo.  [ This
  422.     modification to the behavior of "u." does not conflict (much) with
  423.     traditional use of '.', since by definition, the sequence "u." is
  424.     (almost) always identical to "uu", and the latter is more easily
  425.     typed.  (Credit goes to the designers of "nvi" for this trick.)
  426.     (BTW, the one case i know of where "u." is not identical to "uu" is
  427.     when putting back the contents of the numbered registers:  the
  428.     sequence "1pu.u.u.u. would successively insert the contents of "1,
  429.     "2, "3, "4, and "5, allowing you to choose the "correct" register.
  430.     This sequence no longer works.  You can still put them _all_ back
  431.     with "1p..... and then delete the ones you _don't_ want. ]
  432.  
  433.     The number of changes stored in the undo "history" is controlled by
  434.     the numeric mode "undolimit".  The default history length is 10 --
  435.     that is, only 10 changes may be undone.  Set the undolimit to 0 for
  436.     truly infinite undo.  This can consume a lot of memory.
  437.  
  438.     The cursor position after an undo may not always be the same as it
  439.     would be in vi.
  440.  
  441.     Operators
  442.     ---------
  443.     vi has a class of commands known as "operators".  Operator commands
  444.     are always immediately followed by a motion command.  The region of
  445.     text affected by an operator is bounded on one end by the initial
  446.     position of the cursor, and on the other by the cursor position
  447.     after the motion is completed.  Thus the delete operator ('d') can
  448.     be followed by the word motion command ('w'), causing the next word
  449.     to be deleted.  The sequence "dG" will delete from the cursor
  450.     through the end of the file, and "d/junk" will delete to the next
  451.     occurrence of the string "junk".  As a special "honorary" type of
  452.     motion, operators can all be "stuttered" to affect lines.  Thus
  453.     "dd" deletes one line, "4dd" affects 4 lines, etc.
  454.  
  455.     Most operators affect the region exactly, but some cause only whole
  456.     lines to be affected.  This is usually a function of what sort of
  457.     motion follows the operator, but can sometimes be affected by the
  458.     operator itself.  The best example of motions having different
  459.     effects is the 'goto-mark' motions, the ''' and '`' commands.  If a
  460.     mark is set, say mark 'a', with the 'ma' command, then if the
  461.     command d`a is executed, the exact text between the cursor and the
  462.     mark will be deleted.  If, on the other hand, the d'a command is
  463.     used, the deleted region will include the lines containing the
  464.     cursor and the mark in their entirety.
  465.  
  466.     Some operators in vile can be "forced" to affect regions of whole
  467.     lines, though the motion wouldn't normally imply it, by using the
  468.     '^X' form of the command.  (It's not really forced -- it's really
  469.     a separate operator.)  For example, "d%" (assuming you are on a
  470.     curly brace) will delete a C-style block of code.  "^X-d%" will
  471.     delete that same area, plus anything else on the lines containing
  472.     the curly-brace endpoints.
  473.  
  474.     Note that some operators always affect whole lines, no matter
  475.     how the motion is specified.  The '!' operator is an example:
  476.     "!w" will always filter an entire line, and not just a single word.
  477.  
  478.     vile extends this notion of the "shape" of a region by adding
  479.     the concept of rectangular regions, whose boundaries are
  480.     delimited by the rectangle whose opposite corners are at the
  481.     cursor and at the other end of the motion, respectively.  See
  482.     the section "Rectangular regions" below.
  483.  
  484.     The "show-operators" command will show all available operators.
  485.     The "show-motions" command will show all available motions.
  486.     Any operator may be followed by any motion.
  487.  
  488.     There are several new operator commands in vile:
  489.  
  490.     ^A-~    Is the operator form of the '~' command, so "^A-~~"
  491.         changes the case of all characters on the current
  492.         line, "^A-~w" does it to a word, "3^A-~}" does it for
  493.         3 paragraphs, etc.  (In vile, the simple '~' command
  494.         will take a repeat count, unlike some versions of vi.
  495.         If you wish it to be an operator, rebind '~' to the
  496.         "flip-til" command.)
  497.     ^A-u    Like ^A-~, but converts the region to upper case.
  498.     ^A-l    Like ^A-~, but converts the region to lower case.
  499.  
  500.     ^A-f    Format the region based on the current fill column.  The
  501.         initial indentation of both the first and second lines of
  502.         each "paragraph" in the region are preserved, and all
  503.         subsequent lines get the second line's indentation.  This
  504.         makes indented/outdented paragraphs (like this one) work
  505.         correctly.  (This is intentionally _not_ the same behavior
  506.         obtained by using "!fmt", since that behavior is obviously
  507.         available elsewhere.)  The usual usage of this command is
  508.         "^A-f}", which reformats the current paragraph.  The
  509.         re-formatting begins again with each new paragraph, where a
  510.         paragraph has the same boundaries used by the '{' and '}'
  511.         commands -- i.e. blank lines, or lines beginning in .I .L
  512.         .P .Q or .b.  This makes it possible to use "3^A-f}" or
  513.         "^A-fG" to reformat multiple paragraphs.  The reformatting
  514.         operation knows a little about both C, C++, and shell
  515.         comments, and will attempt to do the "right" thing with
  516.         lines that start with '#' or '*' characters.  (It also knows
  517.         about the '>' character, making it fairly easy to reformat
  518.         mail and news inclusions...  but is it ethical?  :-)
  519.  
  520.     ^X-s    For every occurrence of a search string, put in a replace-
  521.         ment string.  This is similar to "s/pattern/replacement/g"
  522.         over the region.
  523.  
  524.     ^A-&    Is an operator in vile, similar to the traditional & command.
  525.         It repeats the last substitution over the specified region.
  526.         (Unlike the '&' command, this one will remember trailing
  527.         g, p, l, or numeric options.)
  528.  
  529.     ^X-d    Delete the region, including the lines it starts and ends on.
  530.     ^X-c    Change the region, including the lines it starts and ends on.
  531.     ^X-y    Yank the region, including the lines it starts and ends on.
  532.  
  533.     ^A-t    Trim trailing whitespace from all lines in the region.
  534.  
  535.     ^A-<SPACE> Convert tabs to spaces, using the current tabstop value.
  536.     ^A-<TAB>   Convert as many spaces to tabs as appropriate.
  537.  
  538.     ^A-b    Blank out a region.  Turns the region to whitespace.  Useful
  539.         with rectangular regions.
  540.     ^A-r    Open up a rectangle.  Text to the right of the left edge
  541.         of the rectangular region will shift to the right by the
  542.         width of the rectangle, leaving a whitespace "hole".
  543.     ^A-q    Sweep out a rectangle with multiple motion commands.  See
  544.         description of 'q', below.
  545.  
  546.     ^A-s    Select and yank a region.  The region will be highlighted
  547.         on the screen, as if it had been swept by a mouse.  It
  548.         is also yanked, as with the 'y' operator.  This operator
  549.         is useful in combination with the ^S motion command, which
  550.         lets one reference the selected region with other operators.
  551.         (If you use this command much, it is recommended that you
  552.         bind it to and easier to type sequence, such as 'S'.)
  553.     ^X-C    Encrypt or decrypt the region, using the current encryption
  554.         key.  If no key has been set, user will be prompted.  See
  555.         "Encryption" below.
  556.  
  557.     Text insertion
  558.     --------------
  559.     ^X-p    Causes the previously yanked or deleted text, no matter
  560.         how it was obtained, to be inserted after the current line.
  561.         Usually text that did not consist of whole lines where it
  562.         came from is inserted immediately following the cursor.
  563.     ^X-P    As above, but the text is put before the current line.
  564.         Thus "dw" followed by a "p" command does a normal insertion
  565.         of the deleted word, whereas "^X-p" results in the word
  566.         being inserted on a line by itself.
  567.  
  568.     R    vi's overwrite mode is supported.  Note that the combination
  569.         of overwrite mode and the (ANSI) arrow keys can be used to
  570.         give a "picture drawing" mode of operation: anything you
  571.         type goes into the buffer without moving adjacent text, and
  572.         you can move around using the arrow keys without leaving
  573.         overwrite mode.  Hint: start with a buffer full of lines
  574.         that consist entirely of blanks (as opposed to blank
  575.         lines).
  576.  
  577.     ^A-i    Like their 'i', 'o', and 'O' counterparts, but any autoindent
  578.     ^A-o    or cmode setting is ignored for the duration of this insert.
  579.     ^A-O    These are most useful when pre-formatted text is being
  580.         pasted, as when using a mouse.
  581.  
  582.     Searching
  583.     ---------
  584.     ^X-/    Does a forward search for the "word" located under the
  585.         cursor.
  586.     ^X-?    Does a reverse search for the "word" located under the
  587.         cursor.
  588.     ^A-/    Does not do a search, but sets the search pattern to the
  589.         "word" under the cursor.  Useful for "picking up" a word
  590.         from one buffer, and searching for it in another.
  591.  
  592.     The following two commands may not always be present in vile,
  593.         depending on how it was built:
  594.     ^X-S    Incremental forward searching.  As you enter the search
  595.         string, the cursor is advanced to the next match with
  596.         what you've typed so far.  Use ^F and ^R to continue the
  597.         search forward or in reverse, using the current pattern.
  598.     ^X-R    As above, but in reverse.
  599.  
  600.     Tags
  601.     ----
  602.     vile supports vi-style "tags" files.
  603.  
  604.     ":ta" or ":tag" allows you to enter a tagname to locate.  Changes
  605.         to that file and location.
  606.     ^]    Uses the identifier currently under the cursor as the
  607.         tagname.
  608.     ^T or ^X-^] or ":pop" - pops to the file and location just previous
  609.         to the last tag command.
  610.     ^A-^] or ":next-tag" continues searching through the tags file(s)
  611.         for additional matches.
  612.  
  613.     When one of these commands is used, vile will (by default) look for
  614.     a file named "tags" in the current directory, and load it into a
  615.     hidden buffer for use during tag searches.  This buffer is editable
  616.     if you wish (":e tags"), but will not appear in the buffer lists.
  617.     If a buffer named "[Tags 1]" is already available when a tag is
  618.     first requested, it will be used instead of a file found by
  619.     searching the tags setting, and of course will remain visible.
  620.  
  621.     The name of the default tags file may be changed with "set tags"
  622.     (see "tags" under "Editor modes", below).  If multiple filenames
  623.     are given in the "tags" setting (separated by whitespace), they are
  624.     searched in order, and placed in buffers named "[Tags 1]", "[Tags 2]",
  625.     "[Tags 3]", etc.
  626.  
  627.     Tags searched for using '^]' will always be matched exactly.
  628.     If the ":ta" form of the command is used, tag matches will be
  629.     exact unless the mode "taglength" is set non-zero, in which case
  630.     the first tag matching that many characters will be used.
  631.  
  632.     Filenames referred to in tags files are expanded, so environment
  633.     variables and shell special characters like ~ may be used.
  634.  
  635.     The stack of buffer locations waiting to be "popped" to with the
  636.     '^T' (or '^X-^]' or ":pop") command may be viewed with the
  637.     "show-tagstack" command.  The "[Tag Stack]" buffer is animated --
  638.     it will dynamically keep track of current tag references.
  639.  
  640.     Limitations:  In a real vi-style tags file, there are three tab
  641.         separated fields.  The first contains the tagname.  The second
  642.         contains the (relative or absolute) filename.  Everything after
  643.         the second tab is an arbitrary ex-mode command.  vile is not
  644.         quite so flexible as regular vi, and only supports a couple of
  645.         commands in that last "field".  It can be a line number, in
  646.         which case the tag is an absolute index into the file.  Or, it
  647.         can be a search command.  If it begins with a '/', the search
  648.         goes forward.  If it begins with a '?', the search goes
  649.         backward.  In either case, the matching delimiter _must_ be the
  650.         last character on the line in the tags file.
  651.  
  652.         All of this isn't as bad as it sounds, since ctags, the program
  653.         most people use to generate tags files, does generate exactly
  654.         this format.  (Surprise, surprise.)  However, if you attempt
  655.         to create your own tags files, or have other tools that do so,
  656.         you should be aware of these limitations.
  657.  
  658. Miscellaneous commands
  659. ----------------------
  660.  
  661.     ^A-d    Remove blank lines ("deblank").  If the cursor is on a blank
  662.         line, then it and any blank lines surrounding it will be
  663.         removed.  If a non-blank line, then any immediately following
  664.         blank lines will be removed.  If given an argument, will force
  665.         exactly that many blank lines to exist at that point,
  666.         regardless of how many were there before.  Moves current
  667.         location forward, to allow repeated use.
  668.  
  669.     ^X-^X    The "error finder".  Goes to the next file/line error pair
  670.         specified in the last buffer captured from a command's
  671.         output.  This buffer is usually created with the ^X-!
  672.         command.  For example, "^X-!cc -c junk.c" puts all of the
  673.         compiler output into the buffer named "[Output]".
  674.         Repeatedly hitting ^X-^X will position the editor at each
  675.         error in turn, and will eventually start over again at the
  676.         top.  The buffer searched for "errors" will be the last
  677.         shell command run, or the buffer named with the "error-
  678.         buffer" command.  The "Entering directory XXX" and "Leaving
  679.         directory XXX" messages that GNU make puts out with the -w
  680.         switch are honored, so that files are found with the
  681.         correct path.  (Tip: I use the following macro to quickly
  682.         grep a source directory for the string under the cursor:
  683.             use-register g load-register "^X!egrep -n : *.[chs]^M"
  684.         where the ^X and ^M are each single control characters,
  685.         entered using ^V to escape them.  Then I invoke with @g to
  686.         execute. [NB: this macro won't work with DOS versions of
  687.         vile, since ':' doesn't expand to the word under the cursor
  688.         in those versions, since it conflicts with the driver letter
  689.         separator.)
  690.  
  691.         The command parsing is done with regular expressions.  Vile
  692.         compiles these from the buffer [Error Expressions], which are a
  693.         set of regular expressions with extra embedded information.
  694.         Unescaped '%' followed by 'V', 'B', 'F', 'L', 'C' or 'T'
  695.         substitute verb (Entering/Leaving for gmake), buffer (i.e.,
  696.         scratch buffer with a bracketed name), file, line, column and
  697.         text fields.  The V, B, F, T substitutions are for nonblank
  698.         fields, which is not always enough, so vile additionally
  699.         recognizes a range in brackets, e.g.,
  700.  
  701.             ^%[^:     ]:\s*%L:%T
  702.  
  703.         is compiled as
  704.  
  705.             ^\([^:     ]\+\):\s*\([0-9]\+\):\(.\+\)
  706.  
  707.     ^X-t Set or report on the tab-stop width.  To set, the spacing must
  708.         precede the command, as in "4^X-t".  The "set tabstop"
  709.         command described below does the same thing.  The status
  710.         output indicates whether the buffer is currently using the
  711.         local or global copy of the tabstop value.
  712.  
  713.     ^X-f Set the local fill-column to be used with ^A-f and auto-wrap
  714.         mode on insert.  The default value is 7/8's of the screen
  715.         size, with a maximum of 70.  Since arguments come before
  716.         commands, you type: 65^X-f.  The "set fillcol" command does
  717.         the same thing.  The status output indicates whether the
  718.         buffer is currently using the local or global copy of the
  719.         tabstop value.
  720.  
  721.     ^X-X    Set current encryption key for this buffer.  See "Encryption"
  722.         below for more information.
  723.  
  724.     K    Count prefix.  The first time you type it, it is equivalent
  725.         to an argument of 4 to the following command.  If you repeat
  726.         it, it becomes worth 16, the next time 64, etc...
  727.  
  728.     %    In addition to finding matching braces, brackets, and
  729.         parentheses, the '%' command will find matching #if's,
  730.         #ifdef's and C-style comments.  If the cursor is on the #
  731.         of "#ifdef"/"#if", the '%' command will find the matching
  732.         "#endif" or "#else".  On an "#else" it will find "#endif",
  733.         and on "#endif" it will go back up to the "#ifdef"/"#if".
  734.         If the cursor is on any part of a "/*" or "*/" sequence, it
  735.         will find the appropriate corresponding C comment endpoint.
  736.         (See fence-if, fence-pairs to customize this behavior).
  737.  
  738.     \    Identical to the ` motion, in that the cursor moves to
  739.         the specified mark (i.e. \a moves to mark 'a').  When
  740.         used with an operator command, the resulting region is
  741.         rectangular instead of "exact".  This is similar to
  742.         the ' motion, which also goes to [the line holding] the
  743.         mark, and causes regions to become "full line" regions.
  744.  
  745.     q    A "quoted motion" command.  After entering 'q', more motion
  746.         commands are accepted until another 'q' is entered.  The
  747.         result of the motion is the cumulative effect of all the
  748.         entered motions.  Thus, one might type:
  749.             dq<arrow><arrow><arrow>...<arrow>q
  750.         to delete all of the text between the starting point
  751.         and the final cursor position.
  752.  
  753.         Any motion command can appear in between the two 'q'
  754.         commands.  If used alone, i.e. not in an operator
  755.         context, then the spanned text is selected, highlighted,
  756.         and yanked as a side effect.  The resulting selection can
  757.         then be manipulated with the ^S pseudo-motion, below.
  758.  
  759.         Most motions will select up to but not including their
  760.         endpoint.  The 'e', 'E', 'f', 't', and '%' commands are
  761.         exceptions to this.  If used in an operator context the
  762.         cursor position may sometimes appear incorrect.  This
  763.         is because operators sometimes change the cursor location
  764.         internally to force the motion to do the "right" thing,
  765.         and the 'q' command makes these internal "fudge factors"
  766.         visible.  An example of this is "dq%q" which does the
  767.         right thing (assuming the cursor is on a '(' to start)
  768.         but which looks wrong, since the cursor will overshoot
  769.         the ')' before the second 'q' is typed.
  770.  
  771.         If a mouse is available, whether in an xterm via the
  772.         "xterm-mouse" setting, or in xvile, then button 1 can be
  773.         clicked to do the extensions, since it, too, is a motion
  774.         command.  (Of course in xvile, it is easier to simply
  775.         "click and drag" -- the 'q' command isn't really necessary
  776.         at all.
  777.  
  778.         Use the repeat-count to specify types of selection: exact=1
  779.         (default), full-line=2, rectangle=3.
  780.  
  781.     ^A-q    As above, but the motions will sweep out rectangular regions.
  782.  
  783.     ^S    A motion, or "pseudo-motion" command.  If a region of
  784.         text has been previously selected, either with the mouse
  785.         (if available) or with the keyboard selection operator
  786.         (^A-s) it can be referenced by any other operator by
  787.         applying that operator to the ^S motion.  As an example,
  788.         suppose a word is selected with the mouse, or with ^A-sw.
  789.         Then, from anywhere in that buffer, one can use d^S to
  790.         delete that word.  ^S used by itself will move the cursor
  791.         to the start of the selected region.  ^S applied to
  792.         the selection operator (^A-s) will extend the current
  793.         selection to include the current location of the cursor.
  794.  
  795.         ^S makes it possible to select any region (including
  796.         rectangular regions) of text with a mouse, and then apply
  797.         any vi operator to that region.
  798.  
  799.     =    If "visual-matches" is set, then vile will highlight all
  800.         occurrences of a pattern that is searched for with one of
  801.         the usual searching commands.  The '=' command will clear
  802.         this highlighting, until the next search for a different
  803.         pattern.
  804.  
  805.  
  806.     vile can display more of its internal "state" than traditional vi.
  807.     Portions of the internal "state" may be viewed using various
  808.     "show-xxx" commands:
  809.  
  810.     show-abbreviations -- displays list of shortcuts defined with the
  811.         ":abbr" command.  (synonymous with ":abbr<CR>")
  812.  
  813.     show-buffers -- displays the current list of available buffers.  Given
  814.         any numeric argument, will list _all_ buffers, even those
  815.         normally invisible or considered temporary.
  816.  
  817.     show-commands or show-bindings -- displays the list of commands
  818.         and the keys bound to them.
  819.  
  820.     show-global-modes, show-modes -- both synonymous with ":set<CR>"
  821.  
  822.     show-help -- synonymous with ":help", '^A-h', etc.
  823.  
  824.     show-history -- displays the user's command line history.
  825.  
  826.     show-majormodes -- displays the builtin and user-defined major modes.
  827.  
  828.     show-mapped-chars -- displays the strings mapped for command mode
  829.         with ":map".  (synonymous with ":map<CR>")
  830.  
  831.     show-mapped!-chars -- displays the strings mapped for insert mode
  832.         with ":map!".  (synonymous with ":map!<CR>")
  833.  
  834.     show-printable -- displays a table of the printable characters,
  835.         with associated types.
  836.  
  837.     show-registers -- displays the current contents of the named and
  838.         numbered registers.
  839.  
  840.     show-system-mapped-chars -- displays the strings mapped to
  841.         represent the terminal's function keys.
  842.  
  843.     show-tagstack -- displays the contents of the "tags stack", the
  844.         list of locations from which the ":ta" or '^]' commands have
  845.         been used, and to which the ":pop" and '^T' (or '^X-^]')
  846.         commands will return.
  847.  
  848.     show-terminal-chars -- displays the list of special chars normally
  849.         associated with the TTY driver, i.e. backspace, interrupt,
  850.         suspend, etc.
  851.  
  852.     show-variables -- displays the list of vile $variables and user
  853.         %variables, and their values.
  854.  
  855. New Registers
  856. -------------
  857.     In addition to the usual "a through "z, and "1 through "9, vile
  858.     has additional registers.
  859.  
  860.     The register named '<' contains the last few hundred keystrokes
  861.     that have been typed by the user.  The principle use for this
  862.     is to make it easier to create :map commands based on commands
  863.     you've already given.  [It's also useful sometimes when debugging
  864.     to be able to see what key sequence led to a problem...]
  865.  
  866.     The register name '.' contains the current selected text in xvile.
  867.     Also in xvile, the register name ';' is a synonym for the clipboard.
  868.     Other versions of vile permit use of '.' and ';' as supplemental
  869.     register storage.
  870.  
  871.     The register name '"' is a synonym for the default unnamed register,
  872.     which is also sometimes referred to as register 0.
  873.  
  874. Completion
  875. ----------
  876.     Many responses to vile prompts need not be typed in their entirety.
  877.     vile can complete the response for you.  This applies to command
  878.     names, file names, vile modes, vile variables, tags and the
  879.     "terminal characters".
  880.  
  881.     To invoke vile completion, type a few characters and hit TAB (or
  882.     your current "name-complete" terminal character).  Hitting it a
  883.     second time will pop up a window containing the list of possible
  884.     completions.  If there are more completions than will fit in the
  885.     window, hitting further TAB characters will cause that window
  886.     to scroll through the choices.  The window will go away when the
  887.     current command is finished.
  888.  
  889.     An older form of completion is also supported:
  890.         You can also type a question mark (or the current "test-
  891.         completions" terminal character) to display a list of the
  892.         characters that you would have to type to complete the command.
  893.         For example, to complete the "unmark" or "unmap" commands:
  894.         :unm?            -- you type
  895.         :unm{a}[pr]        -- you see
  896.         This style of completion-display shows curly braces around the
  897.         string that will be supplied by pressing TAB, and square
  898.         brackets around characters that you must type to make the
  899.         command unique.
  900.  
  901. Arrow keys
  902. ----------
  903.  
  904.     vile will understand your terminal's arrow keys, as long as they
  905.     are described correctly in the termcap/terminfo database.
  906.     The keys are interpreted as function keys, and are by default bound
  907.     to the up, down, left, and right screen motions.  These bindings
  908.     are honored in insert mode as well as command mode.
  909.  
  910. Rectangular regions
  911. -------------------
  912.  
  913.     Just as the regions defined by vi's commands and motions can either
  914.     be "exact", or encompass "full lines", regions in vile can in
  915.     addition be "rectangular".  The easiest way to use a rectangular
  916.     region is with the '\' motion, which, like '`' and ''', goes to a
  917.     named mark.  The region it describes, however, is "rectangular"
  918.     (instead of "exact" or "full line").  The following operators know
  919.     how to correctly act on rectangular regions:
  920.  
  921.     ^A-r    Opens up a rectangle.  Text to the right of the left
  922.         edge of the rectangle is shifted right by the width of
  923.         the rectangle.
  924.     >    Shift right.  Identical to '^A-r' when region is rectangular.
  925.     d    Deletes the (rectangular) region.  Text to the right moves
  926.         left to fill the rectangle.
  927.     <    Shift left.  Identical to 'd' when region is rectangular.
  928.     y    Yanks the (rectangular) region.  (vile remembers that the
  929.         yanked text is rectangular in shape.
  930.     c    Change the region.  If the region is _not_ rectangular,
  931.         insert mode is entered after the region is deleted.  If
  932.         the region _is_ rectangular, the user is prompted for
  933.         text with which the lines of the rectangle will be filled.
  934.     ^A-u ^A-l ^A-~ ^A-b    These four operators perform their character
  935.         transformations on rectangular regions, as well as exact or
  936.         full-line regions. (uppercase, lowercase, flip-case, and
  937.         blank, respectively)
  938.  
  939.     p P     The 'put'ting commands know whether the text being 'put' was
  940.         originally rectangular, and will do a rectangular insert
  941.         of the text, in front of or behind the cursor.  The
  942.         cursor position defines the upper left corner of the
  943.         insertion.
  944.     ^A-p    These two forms of the put command force the text being
  945.     ^A-P    'put' to be inserted as if it had been rectangular when
  946.         originally yanked or deleted.  The width of the rectangle
  947.         is the length of the longest line in register being 'put'.
  948.  
  949.     Note that because it is sometimes hard to manipulate rectangles
  950.     containing or bordering on tab characters, currently (for some
  951.     operations) vile "detabs" the region being operated on before
  952.     commencing, and re-entabs the lines again after the operation.  The
  953.     re-entabing is limited to leading whitespace, and of course is
  954.     suppressed if "notabinsert" mode is set.  [ This misfeature is
  955.     arguably a bug, and may be fixed.  In the meantime, you've been
  956.     warned. ]
  957.  
  958. Editor modes
  959. ------------
  960.  
  961.     Modes come in three "flavors".  They are universal, and affect the
  962.     editor generally, or are associated with either buffers or with
  963.     windows, and are usually inherited from a set of "global" buffer
  964.     and window modes.  The value of a buffer or window mode will track
  965.     changes to the respective global mode, until the "local" value is
  966.     set independently of the global one.
  967.  
  968.     You can also define new modes, called "majormodes", which are
  969.     collections of buffer mode values, together with qualifiers that
  970.     automatically assign a majormode to new buffers.  Vile has one
  971.     built-in majormode, "c" (displayed as "cmode").  The associated
  972.     majormode values are named according to the corresponding buffer
  973.     modes, e.g., the "c" majormode's tabstop is predefined as
  974.     "c-tabstop", or "cts" for short.
  975.  
  976.     To set or change a global mode, use ":set".  To remove the mode,
  977.     use ":unset", ":setno", or ":set" with the modename prefixed with
  978.     "no".
  979.  
  980.     To set and reset local modes, use ":setl", ":unsetl", ":setlno".
  981.  
  982.     To display modes, use ":setall", ":modes", or ":set all".  Local
  983.     mode values are only shown if they differ from the global values,
  984.     whether they have been independently set or not.  The "local"
  985.     version of the set/unset commands ("setl"/"unsetl") do not make
  986.     sense when used with universal modes, since there is only one
  987.     copy of these.
  988.  
  989.     To define majormodes, use ":define-majormode".  To remove the
  990.     majormode, use ":remove-majormode".  Some keywords (e.g., suffixes)
  991.     are automatically associated with each majormode.  To associate a
  992.     buffer mode with a majormode, use ":define-submode".  To remove the
  993.     association, use ":remove-submode".  Once associated, submodes can
  994.     be set and unset just like regular buffer modes.  Use
  995.     ":show-majormodes" to display the list of majormodes with their
  996.     associated submodes.  The ":setall" command displays the names of
  997.     the majormodes only, showing which are currently enabled (i.e.,
  998.     vile compares each new buffer against the preamble and suffixes to
  999.     determine if the majormode should be set for that buffer.  Only one
  1000.     majormode can be set for a buffer.
  1001.  
  1002.     The possible modes, with synonyms in parentheses, and a trailing U,
  1003.     M, B or W indicating whether the mode is universal, or belongs to
  1004.     majormodes, buffers or windows, are:
  1005.  
  1006.     alt-tabpos (atp) If set, vile will position the cursor over tab and
  1007.         control characters the way emacs would, that is, at the
  1008.         start of a tab or control character display sequence.  If
  1009.         turned off (the default), the cursor is positioned over
  1010.         tabs and control characters the way it would be in vi, i.e.
  1011.         at the end of the tab or control character display
  1012.         sequence.  (To match the behavior of earlier versions of
  1013.         vile, should be set.) (U)
  1014.  
  1015.     animated Controls whether vile automatically updates the contents of
  1016.         scratch buffers when their contents would change.  The animated
  1017.         buffers include:
  1018.             [Binding List]
  1019.             [Buffer List]
  1020.             [Major Modes]
  1021.             [Map Sequences]
  1022.             [Map! Sequences]
  1023.             [Registers]
  1024.             [Settings]
  1025.             [Terminal Characters]
  1026.             [Tag Stack]
  1027.         Turning off "animated" is rarely necessary: the capability
  1028.         is present mostly as a debugging aid.  (B)
  1029.  
  1030.     autobuffer (ab) Controls whether vile uses "most-recently-used"
  1031.         style buffering, or vi-style (command-line order) buffers.
  1032.         That is, if autobuffer is on, then buffers are sorted in
  1033.         order of use, in that buffers not frequently used will
  1034.         drift to the end of the list.  If this mode is not on, then
  1035.         vile will behave more like vi, in that buffers remain in a
  1036.         fixed order, that in which they were edited. (U)
  1037.  
  1038.     autowrite (aw)  vile will write out any changed buffers for which
  1039.         this mode is set before performing a ^Z, "stop", "suspend",
  1040.         ":!<cmd>", or '^X-!<cmd>'.  The ":sh" command is not
  1041.         affected, nor is ":stop!" or ":suspend!".  Since buffers
  1042.         inherit the global value of a mode, simply setting the
  1043.         global autowrite value will cause all buffers to be
  1044.         auto-written.  Individual buffers can be forced or
  1045.         prevented from autowriting by setting the local value of
  1046.         the mode for those buffers appropriately.  [In real vi,
  1047.         autowrite mode will also force buffers to be written when
  1048.         switching between files.  This is unnecessary in vile.] (B)
  1049.  
  1050.     autoindent (ai) During insert, newly created lines inherit their
  1051.         leading indent from the previous line in the buffer. (B)
  1052.  
  1053.     autosave (as) Automatic file saving.  Writes the file after every
  1054.         'autosavecnt' characters of inserted text.  Other file
  1055.         changes are not counted.  (B)
  1056.  
  1057.     autosavecnt (ascnt) How often (after how many inserted characters)
  1058.         will automatic saves take place.  256 by default. (B)
  1059.  
  1060.     backspacelimit (bl)  When in insert mode, this controls whether
  1061.         one can backspace past the point at which the insert began. (B)
  1062.  
  1063.     backup-style  Specifies the style used for creating file backups
  1064.         when a file is written.  Can have values of "off", ".bak",
  1065.         and (under UNIX) "tilde", for no backups, DOS-style .BAK
  1066.         files, and file.c~ style backups, respectively.  Files
  1067.         are copied before being written, to protect links to
  1068.         the original file.  Permissions, modification and access
  1069.         times are all preserved.  If creation of the backup fails,
  1070.         the write of the file will fail, unless it is forced
  1071.         using the ":w!" form of the write command.  (U)
  1072.  
  1073.     bcolor    On systems supporting this, will set the background color.
  1074.         Currently only terminfo/termcap, OS/2 and PC's (Win32, DOS) can
  1075.         do color, although the X11 version (xvile) can be given colors
  1076.         at startup or via .Xdefaults.  See notes about the color
  1077.         palette down below, under DOS specifics.
  1078.  
  1079.     check-modtime  Check modification-time.  If a file has changed since
  1080.         it was last read or written, vile will issue a "file newer
  1081.         than buffer" warning and prompt appropriately for
  1082.         confirmation when 1) popping up a window on an existing
  1083.         buffer, 2) reading or writing the buffer, or 3) after
  1084.         performing some shell command.  The prompt will occur only
  1085.         once, unless the modification time of the file changes
  1086.         again, in which case the warning will be repeated.  The
  1087.         warning will be repeated in any case if the file is being
  1088.         written.  Invoking a shell, or suspending/restarting vile,
  1089.         will cause all visible buffers (those currently in windows)
  1090.         to have their times checked immediately.
  1091.  
  1092.     cmode   C-code mode.  A built-in majormode.  Also useful for other
  1093.         languages.  Maintains current indentation level
  1094.         automatically during insert, like autoindent, above.  If a
  1095.         line ends with a '{', '(', or ':', then the next line
  1096.         indents further.  If a line begins with a '}' or ')', it is
  1097.         lined up with the line containing the matching '{' or '('.
  1098.         If a line starting with '#' is inserted it is moved to
  1099.         column 1.  Additionally, if a line begins with a '#'
  1100.         character, it will not shift right with the '>>' command. (M)
  1101.  
  1102.     crypt    Causes buffer(s) to be decrypted when read, and encrypted
  1103.         when written.  This is NOT compatible with the UNIX
  1104.         crypt(1) routines.  See the section on "Encryption" for
  1105.         more information.  (B)
  1106.  
  1107.     comment-prefix A regular expression denoting the portion of a line
  1108.         that is replicated and untouched, except for leading
  1109.         indentation when doing text formatting.  The expression
  1110.         should begin with "^", e.g., the default value
  1111.             ^\s*\(\s*\([#*>]\)\|\(///*\)\)\+
  1112.         is useful for matching shell comments (#), multi-line C
  1113.         comments (*), multi-line C++ comments (//), and email (>).  (B)
  1114.  
  1115.     comments A regular expression defining commented paragraph
  1116.         delimiters.  This is used in addition to the "paragraphs"
  1117.         expression (see below) when reformatting a region.  The net
  1118.         effect is that paragraphs inside of these comments are
  1119.         preserved when doing text reformatting, but are not
  1120.         reachable with the '}' and '{' motions.  (B)
  1121.  
  1122.     dirc    Causes vile to check each name when scanning directories for
  1123.         filename completion.  This is slower, but provides additional
  1124.         information allowing you to distinguish between directory and
  1125.         file names in the prompt.  (U)
  1126.  
  1127.     dos    On input, if the global copy of this mode is set, then
  1128.         incoming CR/LF pairs are taken as line terminators, the CR
  1129.         characters are stripped out, and the local dos mode is set
  1130.         for the buffer.  (Actually, the local dos mode is only set
  1131.         if the _majority_ of lines had CR characters at the end.)
  1132.         If global dos mode is _not_ set, then incoming CR
  1133.         characters will be left visible on the screen (as '^M'),
  1134.         and the local mode will not be set.
  1135.  
  1136.         On output, when writing a buffer with local dos mode set,
  1137.         all lines will be terminated with CR/LF pairs, rather than
  1138.         the usual single LF.
  1139.  
  1140.         When buffers representing non-existent files are created
  1141.         they will inherit the line-style of the operating system
  1142.         (LF-only on UNIX and VMS, CRLF-style on DOS derivatives)
  1143.         regardless of the global setting of dos mode.
  1144.  
  1145.         Setting dos mode makes editing binary files unreliable.
  1146.         The global value for this mode is set on by default in DOS
  1147.         versions of vile, and should therefore be turned off if
  1148.         doing binary editing.  (B)
  1149.  
  1150.     errorbells (eb) Controls whether a bell sounds (or whether the
  1151.         screen flashes, if "flash" mode is on") when an error
  1152.         occurs. (U)
  1153.  
  1154.     expand-chars Controls the set of characters that are expanded in
  1155.         command lines.  These include
  1156.             '%' (the current buffer),
  1157.             '#' (the alternate buffer),
  1158.             '!' (the last shell command) and
  1159.             ':' (the token at the cursor position).  For VMS
  1160.                 and MS-DOS, this is '&'.
  1161.         (U)
  1162.  
  1163.     expand-path Controls whether %/# are expanded to the full pathname
  1164.         of a buffer, or just to its basename (i.e. the name with
  1165.         the path stripped off).  (U)
  1166.  
  1167.     fcolor    On systems supporting this, will set the foreground color.
  1168.         Currently only terminfo/termcap, OS/2 and PC's (Win32, DOS) can
  1169.         do color, although the X11 version (xvile) can be given colors
  1170.         at startup or via .Xdefaults.  See notes about the color
  1171.         palette down below, under DOS specifics.
  1172.  
  1173.     fence-begin
  1174.     fence-end Respectively, the regular expressions for balancing simple
  1175.         (character-oriented, non-nestable) fences.
  1176.  
  1177.     fence-if
  1178.     fence-elif
  1179.     fence-else
  1180.     fence-fi Respectively, the regular expressions for balancing
  1181.         line-oriented, nested fences, e.g., as C-preprocessor lines
  1182.         (the default).
  1183.  
  1184.     fence-pairs  Each pair of characters in this string is taken to be
  1185.         a set of "fences", which should be matched with the '%'
  1186.         command.  The default value is "{}()[]", which produces
  1187.         normal vi behavior.  This can, for instance, be augmented
  1188.         with the '<' and '>' characters ("{}()[]<>") to cause angle
  1189.         brackets to be matched as well.  See "showmatch" mode for
  1190.         another use of the "fence-pairs" mode.  (B)
  1191.  
  1192.     fillcol (fc)  Sets the value for the fill column, which is the
  1193.         column at which autowrapping and region formatting will
  1194.         break lines.  (B)
  1195.  
  1196.     flash   If your terminal can, will flash the screen rather than
  1197.         beeping on errors.  No audible or visible indication will
  1198.         occur at all if "errorbells" mode is not set on.  (U)
  1199.  
  1200.     glob    Controls how wildcard characters (e.g., '*' and '?') are
  1201.         treated in prompts for filenames.  Set glob to 'off' to
  1202.         disable expansion, or to 'on' to use the internal globber.
  1203.         The internal globber will handle *, ?, [a-z] style ranges,
  1204.         environment variables, and the ~user notation for finding
  1205.         home directories.
  1206.  
  1207.         On UNIX, glob can be set to be a pipe command that
  1208.         will expand more wildcards.  The default value of
  1209.         glob on UNIX is "!echo %s", which should provide globbing
  1210.         that matches that of your shell.  If set to a command that
  1211.         will separate filenames with newlines or nulls rather than
  1212.         spaces, then filenames containing spaces may be more easily
  1213.         edited.  ("!/bin/ls -d %s" is one possibility, "!glob %s"
  1214.         is another if you use csh.) (U).
  1215.  
  1216.     history (hi) When true (the default), commands from the :-line are
  1217.         logged in a buffer [History].  Turning this off causes the
  1218.         buffer to be removed.  (U)
  1219.  
  1220.     horizscroll (hs) If the cursor is moved "off-screen", this mode
  1221.         controls what happens.  If set (as it is by default), the
  1222.         whole screen will shift sideways to make the cursor position
  1223.         visible.  If not set, then only the current line will shift,
  1224.         which may be desirable on slower displays. (W)
  1225.  
  1226.     ignorecase (ic) Text searches normally match the pattern exactly.
  1227.         With this set, searches are case-insensitive. (B)
  1228.  
  1229.     implybuffer (ib) Causes vile to create a buffer when you write to a new
  1230.         file, or read from one (e.g., with ":r").  (U)
  1231.  
  1232.     linewrap (lw) Displays lines that are too long to fit on one line as a
  1233.         series of "wrapped" lines.  Overrides left/right scrolling
  1234.         controlled by "sideways" and "horizscroll" modes.  (W)
  1235.  
  1236.     list    (li) The buffer will be displayed with tabs and newlines made
  1237.         visible, instead of as whitespace. (W)
  1238.  
  1239.     magic Honor unescaped regular expression metacharacters in search
  1240.         strings.  See the section "Regular Expressions" for more
  1241.         detail.  (B)
  1242.  
  1243.     meta-insert-bindings (mib)  Controls behavior of 8-bit characters
  1244.         during insert.  Normally, key-bindings are only operational
  1245.         when in command mode: when in insert mode, all characters
  1246.         are self-inserting.  If this mode is on, and a meta-character
  1247.         (i.e.  a character with the 8th bit set) is typed which is
  1248.         bound to a function, then that function binding will be
  1249.         honored and executed from within insert mode.  Any unbound
  1250.         meta-characters will remain self-inserting.  (B)
  1251.  
  1252.     mini-hilite (mh) When user toggles editing mode in the minibuffer
  1253.         (^G, mini-edit), display the minibuffer with the given
  1254.         attribute.  These are the same as for visual-matches.
  1255.  
  1256.     multibeep If a motion command fails, then vile, like vi, will
  1257.         normally sound the bell.  Turning this mode off prevents
  1258.         subsequent identical motion failures from also sounding the
  1259.         bell.  That is, if you repeat a failed motion many times
  1260.         (e.g. by holding down the backspace key), you only get one
  1261.         beep.  (U)
  1262.  
  1263.     newline (nl) The buffer ends with a newline.  This is set when reading
  1264.         a buffer.  (B)
  1265.  
  1266.     number    (nu) All lines in the buffer will be prefixed by their line
  1267.         number. (W)
  1268.  
  1269.     maplength Controls the maximum length of a :map string, to prevent
  1270.         runaway recursion.  This is the total number of characters that
  1271.         can be gotten during a :map expansion; vile pushes characters
  1272.         onto the stack, so this is only a rough measure.  (U)
  1273.  
  1274.     maplonger Controls whether the longer or shorter of two "nested"
  1275.         map strings will be favored by the editor.  When set, vile
  1276.         will match the longest available mapped string.  When reset,
  1277.         (the default) vile will match the shortest available map.
  1278.         For more information, see the section describing the ":map"
  1279.         command, below.  (U)
  1280.  
  1281.     paragraphs A regular expression defining where the "next-paragraph"
  1282.         ('}') and "previous-paragraph" ('{') commands will go. (B)
  1283.  
  1284.     popup-choices (pc) Must be set to one of the following three
  1285.         values: "off", "immediate", or "delayed".  When enabled
  1286.         with either "immediate" or "delayed", vile pops up the
  1287.         [Completions] buffer showing choices for filename and
  1288.         command completion in response to a TAB.  "immediate" will
  1289.         force the buffer to be popped up immediately if no progress
  1290.         is made in forming a completion.  "delayed" will cause vile
  1291.         to wait until TAB is pressed a second time before popping
  1292.         up the completion choices.  (U)
  1293.  
  1294.     popup-msgs (pm) When enabled, vile pops up the [Messages] buffer
  1295.         showing the text that was written to the message line.
  1296.         Closing the window clears its content until the next
  1297.         message is written.  This is most useful during the
  1298.         debugging of macros, since many messages may appear,
  1299.         each overwriting a previous one.  This mode is treated
  1300.         specially during startup; unless the startup file
  1301.         (e.g., .vilerc) sets it, all messages will be popped
  1302.         up, then the mode will be initialized to "false".  (U)
  1303.  
  1304.     preamble (pre) A regular expression describing the first line of
  1305.         filenames for which the corresponding majormode will be
  1306.         set.  For example, you may have a majormode "sh", with
  1307.         sh-preamble set to "^#\s*!\s*\/.*sh\>" to match the
  1308.         lines "# ! /bin/sh", "#!/bin/csh -f", etc.  (M)
  1309.  
  1310.     printing-low The integer value representing the first of the
  1311.         printable set of "high bit" (i.e. 8-bit) characters.
  1312.         Defaults to 0.  Most foreign (relative to me!) users would
  1313.         set this to 160, the first printable character in the upper
  1314.         range of the ISO 8859/1 character set.  Characters 128-159 are
  1315.         control characters in the ISO scheme (e.g., ISO 8859-1).  (U)
  1316.  
  1317.     printing-high The integer value representing the last character of
  1318.         the printable set of "high bit" (i.e. 8-bit) characters.
  1319.         Defaults to 0.  Set this to 255 for ISO 8859/1
  1320.         compatibility.  The printing-low and printing-high modes
  1321.         are not necessary if your system supports the locale
  1322.         functions.  (U)
  1323.  
  1324.     readonly (ro) Prevent writing a buffer to its associated file.  Unlike
  1325.         "view" mode (see below) which prevents any modifications to
  1326.         a buffer, this mode allows changes, but prevents updates.
  1327.         This is set automatically for the output of shell commands
  1328.         and pipes. (B)
  1329.  
  1330.     readonly-on-readonly (roro) Causes "readonly" mode to be set for
  1331.         read-only files.  Normally vile will attempt to write files
  1332.         whether the operating system will allow it or not.  This
  1333.         mode should be turned on to truly mimic vi's default
  1334.         behavior.  (U)
  1335.  
  1336.     remap   Controls whether :map or :map! sequences entered with
  1337.         no explicit remapping control should be subject to remapping
  1338.         (i.e. recursive mapping).  (U)
  1339.  
  1340.     remapfirst Controls whether the first character of a map expanded
  1341.         due to :map or :map! is eligible for remapping.  This is
  1342.         off by default for vi compatibility.
  1343.  
  1344.     report    A threshold value that is used to control messages that report
  1345.         the number of lines deleted, changed, etc.  (U)
  1346.  
  1347.     resolve-links Controls whether vile fully resolves file names in
  1348.         cases where some path components are symbolic links.  This
  1349.         makes vile smarter about symbolic links that provide
  1350.         multiple paths to a given file (preventing multiple
  1351.         unintentional edits of the same physical file via different
  1352.         pathnames).  It may trigger long timeouts on systems where
  1353.         symbolic links are used in conjunction with NFS automounted
  1354.         directories.  (Note that this does not detect or prevent
  1355.         multiple edits caused by hard file links -- only symbolic
  1356.         ones.) (U)
  1357.  
  1358.     ruler Shows the current line and column in the status line, as
  1359.         well as what percentage of the current buffer's lines lie
  1360.         in front of the cursor.  (This percentage is different than
  1361.         that given by ^G (the "position" function), which gives a
  1362.         percentage of characters rather than lines.) (B)
  1363.  
  1364.     samebangs (sb) Controls whether the ":!!" and "^X-!" commands
  1365.         remember the same command string.  (U)
  1366.  
  1367.     sections A regular expression defining where the "next-section" (']')
  1368.         and "previous-section" ('[') commands will go. (B)
  1369.  
  1370.     shiftwidth (sw) This is much like a tabstop, except that it is
  1371.         independent of hardware tabs and tab characters.  It is the
  1372.         number of columns a line will shift by if the '<<' or '>>'
  1373.         commands are used, and it chooses the next column stop for
  1374.         the cursor if a '^T' or '^D' is typed during insert mode. (B)
  1375.  
  1376.     showmatch (sm) During insert, if a closing "fence" character
  1377.         (usually '}', ']', or ')', but may be changed by setting
  1378.         "fence-pairs") is typed, the cursor will highlight the
  1379.         matching member of the pair for about a quarter second.
  1380.         (B)
  1381.  
  1382.     showmode (smd) Causes an indicator on the modeline to indicate what
  1383.         mode vile is currently in: insert (I), replace (R), or
  1384.         command (none).  (B)
  1385.  
  1386.     showram (sr) Displays the amount of ram currently allocated at the
  1387.         end of the message line. (not in all versions) (U)
  1388.  
  1389.     sideways  Will prompt for a new value for the sideways scroll offset,
  1390.         which allow display of a section of code normally off the
  1391.         screen to the right.  Also affected by the ^X-^R and ^X-^L
  1392.         commands.  (W)
  1393.  
  1394.     smoothscroll (ss) Force smooth scrolling.  By default, this option
  1395.         is turned off so that vile will try to keep up with your
  1396.         keystrokes instead of keeping the display up to date.  Some
  1397.         keyboards repeat faster than the screen can keep up causing
  1398.         the screen to jump.  If this bothers you, set smoothscroll
  1399.         to true.  Warning: If your keyboard repeats really fast and
  1400.         you have smoothscroll enabled, it may take a while for vile
  1401.         to catch up.  (U)
  1402.  
  1403.     spaces-after-sentence (sas) Insert two spaces after each sentence
  1404.         when formatting a paragraph.  By default this option is
  1405.         turned on.  When disabled, the format routiine will insert
  1406.         only one space after each sentence.  (U)
  1407.  
  1408.     suffixes (suf) A regular expression describing filenames for which
  1409.         the corresponding majormode will be set.  This is arguably
  1410.         misnamed, since the regular expression need not describe
  1411.         only suffixes.  (M)
  1412.  
  1413.     tabinsert (ti) Allow the physical insertion of tab characters into
  1414.         the buffer.  If turned off ("notabinsert"), and an attempt
  1415.         is made to insert a tab character by explicitly typing it
  1416.         or by using shiftwidth or the line shifting commands, then
  1417.         the appropriate number of space characters will be inserted
  1418.         instead.  Use '^V^I' to insert a real tab, and remember
  1419.         that pre-existing tabs will not be affected.  Use the
  1420.         '^A-<SP>' operator command to eliminate pre-existing tabs
  1421.         from a region of text.  (B)
  1422.  
  1423.     tabstop (ts) Set the value for spacing of normal tabstops. (B)
  1424.  
  1425.     tagignorecase (tc) Causes tag searches to be done ignoring upper
  1426.         and lower case. (B)
  1427.  
  1428.     taglength (tl) Sets the significant length for tags.  If non-zero,
  1429.         lookups for names longer than the taglength value will only
  1430.         attempt to match that many characters.  If a lookup is for
  1431.         a shorter pattern, or the value of taglength is zero, then
  1432.         the tags must match the lookup pattern exactly.  This will
  1433.         not effect tags picked up from the cursor -- they are
  1434.         always matched exactly.  (B)
  1435.  
  1436.     tagrelative (tr) Causes files looked up via the tags mechanism to
  1437.         be found relative to the location of the tags file, rather
  1438.         than relative to the current directory. This allows the
  1439.         same tags file to be useful from different locations, while
  1440.         not requiring absolute filenames.  For example, using
  1441.         `set tags "tags ../tags"' would allow a single tags file
  1442.         (located in the parent) to be used in a small source
  1443.         hierarchy from either the parent or a child directory.  (B)
  1444.  
  1445.     tags    Gives a path of names of file(s) in which to look up
  1446.         tag references.  It is a whitespace-separated list of
  1447.         filenames.  Relative pathnames in this list are evaluated
  1448.         with respect to the current directory of vile at the time
  1449.         of the tags lookup.  (B)
  1450.  
  1451.     tagword (tw) When scanning the word to lookup from the cursor position
  1452.         for the tags mechanism, grab the whole word rather than the
  1453.         substring starting at the cursor position.  The latter, which
  1454.         is vi-like, is the default.  (B)
  1455.  
  1456.     terse   vile produces more "status" messages than vi, which may
  1457.         become annoying at low baud rates.  Setting terse mode will
  1458.         suppress many of these.  (B)
  1459.  
  1460.     terse-selections (tsel)  Boolean indicating whether or not additional
  1461.         information is displayed about a selection.  When false, the
  1462.         starting and ending positions of the selection are displayed
  1463.         as the selection is extended.  The default is true. (W)
  1464.  
  1465.     timeoutlen  How long to wait for the characters of a :map'd sequence.
  1466.         Typically needed to resolve the ambiguity between a
  1467.         user-pressed ESCape key and an ESC character that is part
  1468.         of a function key sequence.  vile will wait for "timeoutlen"
  1469.         milliseconds after seeing an ESC, in order to check the
  1470.         next character of input.  The time defaults to 500, or half
  1471.         a second.  Users of fast local screens, like a local xterm,
  1472.         may wish to reduce this to something like 50 for crisper
  1473.         response to a user-pressed ESC.  (U)
  1474.  
  1475.     timeoutlen-user  If set non-zero, this will enforce a maximum
  1476.         waiting time for characters in a user-defined :map sequence.
  1477.         If zero, the value of timeoutlen, above, will be used for
  1478.         both "system" and user sequences.  It is likely that a
  1479.         short time is desired for system sequences, and a long time
  1480.         for user sequences.  For this reason the default value of
  1481.         timeoutlen-user is 60000.  This will give a full minute to
  1482.         type each character of a user-defined :map.  Be careful --
  1483.         extremely large values may overflow the word size on
  1484.         smaller machines, i.e, you will probably want to avoid
  1485.         setting timeoutlen-user larger than 65535.  (U)
  1486.  
  1487.     undolimit (ul) Sets a limit on how many undoable buffer-changing
  1488.         commands will be saved.  If set to 0, there is no limit,
  1489.         and all changes are undoable.  The default value is 10. (B)
  1490.  
  1491.     unprintable-as-octal (uo) If an 8-bit character is non-printing, it
  1492.         will normally be displayed in hex.  This setting will force
  1493.         octal display.  Non-printing characters whose 8th bit is
  1494.         not set are always displayed in control character (e.g. '^C')
  1495.         notation.  (B)
  1496.  
  1497.     view    View the file only.  No changes are permitted.  (B)
  1498.  
  1499.     view-on-readonly (viewro) Causes "view" mode to be set for
  1500.         read-only files.  (U)
  1501.  
  1502.     visual-matches When a search command is executed, the cursor will
  1503.         move as usual.  In addition, all matching occurrences of
  1504.         the searched-for pattern (in the current buffer) will be
  1505.         emphasized according to the value of this mode: "none",
  1506.         "underline", "bold", "italic", or "reverse".  Additionally,
  1507.         on systems which support color, this mode may be used to set
  1508.         the text foreground color using any of the color values.
  1509.  
  1510.         The '=' command can be used to clear this sort of
  1511.         highlighting, until the next search is done for a different
  1512.         pattern.  Note that setting this mode can significantly
  1513.         slow down the editor's operation when complex or frequently
  1514.         occurring patterns are used, since vile will need to scan
  1515.         the entire buffer for matches on any change to the buffer.
  1516.         (B)
  1517.  
  1518.     warn-rename  When using ":e" to find a file that has the same name
  1519.         as another buffer, vile will normally offer for you to edit
  1520.         the proposed alternate name for the buffer constructed by
  1521.         adding a "-1", "-2", etc. to the end of the name.  Turning
  1522.         off "warn-rename" will make vile choose buffer names without
  1523.         user intervention.  (U)
  1524.  
  1525.     warn-reread  When using ":e!" to reread a buffer from the file on
  1526.         disk, vile will normally warn you that you are about to
  1527.         clobber a modified buffer.  Turning off "warn-reread" mode
  1528.         will make vile assume you known what you are doing.  (U)
  1529.  
  1530.     warn-unread  When leaving the editor, if not all buffers have been
  1531.         "visited", then normally vile will complain, and remind the
  1532.         user to use ":q!".  Turning off "warn-unread" mode will
  1533.         suppress this behavior.  (U)
  1534.  
  1535.     working If turned off (noworking), will suppress the activity
  1536.         indicator ("working..."/"...working") which appears during
  1537.         long-running operations.  (U)
  1538.  
  1539.     wrapmargin (wm)  Implements vi's auto-wrap mode.  If nonzero, the
  1540.         wrapmargin specifies the number of columns on the
  1541.         screen's right margin to reserve before breaking the input
  1542.         lines on a preceding space.  Thus a value of 5 and an
  1543.         80 column screen will result in 75 character lines.  This
  1544.         mode is different from the "wrapwords" mode (below) which
  1545.         uses the "fillcol" setting as its target column.  The two
  1546.         modes probably shouldn't both be used at once.
  1547.         (B)
  1548.  
  1549.     wrapscan (ws) Text searches will continue from past the bottom of
  1550.         the file to the top, and vice-versa.  (B)
  1551.  
  1552.     wrapwords (ww) [deprecated] Similar to, but different from, vi's
  1553.         auto-wrap mode (i.e. "wrapmargin").  While inserting,
  1554.         words are moved to the next line if the current line gets
  1555.         too long.  Wrapping is only attempted when a space is
  1556.         typed.  The target maximum width of lines is changed with
  1557.         the "fillcol" setting.  (B)
  1558.  
  1559.     xterm-mouse Enables mouse-clicking if you are running within an
  1560.         xterm.  That is, it allows vile to receive mouse events.
  1561.         Since this mode overrides xterm's cut & paste, you will
  1562.         need to use the Shift key when pressing the mouse buttons
  1563.         to cut and paste between X windows.  Your TERM variable's
  1564.         termcap entry must contain the string "xterm" for this to
  1565.         work.  (U)
  1566.  
  1567. 8-Bit Operation
  1568. ---------------
  1569.  
  1570.     vile allows input, manipulation, and display of all 256 possible
  1571.     byte-wide characters.  (Double-wide characters are not supported.)
  1572.  
  1573.     Output
  1574.     ------
  1575.     By default, characters with the high bit set (decimal value 128 or
  1576.     greater) will display as hex (or octal; see "non-printing- octal"
  1577.     above) sequences, e.g.  \xA5.  A range of characters which should
  1578.     display as themselves (that is, characters understood by the user's
  1579.     display terminal) may be given using the "printing-low" and
  1580.     "printing-high" settings (see above).  Useful values for these
  1581.     settings are 160 and 255, which correspond to the printable range
  1582.     of the ISO-Latin-1 character set.
  1583.  
  1584.     Input
  1585.     -----
  1586.  
  1587.     There are basically three ways of getting 8-bit characters into
  1588.     a vile buffer:
  1589.  
  1590.     Directly -- if the user's input device (i.e. the terminal or
  1591.         xterm) can generate all characters, and if the terminal
  1592.         settings are such that these characters pass through
  1593.         unmolested, then vile will happily incorporate them into the
  1594.         user's text, or act on them if they are bound to functions.  On
  1595.         an xterm, try "stty cs8 -parenb -istrip".  Real serial lines
  1596.         may take more convincing, at both ends, but use that stty
  1597.         command as a starting point.
  1598.  
  1599.     As numbers -- the ^V prefix (or, more correctly, the key bound to
  1600.         the "quote-next-character" function), if followed by up to
  1601.         three digits, will insert a character whose value is that
  1602.         number (no greater than 255) into the buffer.  The number may
  1603.         be entered in decimal (^VNNN), octal with a leading '0' (^V0NNN),
  1604.         or hex with a leading 'x' (^VxNN).
  1605.  
  1606.     As digraphs -- Perhaps more useful to some people is using a set of
  1607.         ":map!" commands to aid insertion of 8-bit text.  The file
  1608.         "digraphs.rc" distributed with the vile source contains a set
  1609.         of mappings which should aid the input of ISO 8859/1 text.  As
  1610.         examples, the mappings in digraphs.rc allow one to type ^Ku"
  1611.         to get an umlaut character, ^K12 to get the little '1/2'
  1612.         symbol, ^KY- to get the Yen currency symbol, or ^K:- to get an
  1613.         arithmetic division symbol.
  1614.  
  1615.     Users who have no need to enter 8-bit text may want access to the
  1616.     meta-bound functions while in insert mode as well as command mode.
  1617.     The mode "meta-insert-bindings" controls whether functions bound to
  1618.     meta- keys (characters with the high bit set) are executed only in
  1619.     command mode, or in both command and insert modes.  In either case,
  1620.     if a character is _not_ bound to a function, then it will be
  1621.     self-inserting when in insert mode.  (To bind to a meta key in the
  1622.     .vilerc file, one may specify it as itself, or in hex or octal, or
  1623.     with the shorthand 'M-c' where c is the corresponding character
  1624.     without the high bit set.
  1625.  
  1626.     (Although it is possible to edit and view all 256 characters, it is
  1627.     currently impossible to _search_ for a string that contains the NULL
  1628.     character, since this is used internally to terminate the search
  1629.     string.)
  1630.  
  1631. Command History
  1632. ---------------
  1633.  
  1634.     You may scroll through the list of previous replies to the :-prompt
  1635.     by using the up- or down-arrow special keys on your keyboard (if
  1636.     your configuration supports it).
  1637.  
  1638. Editing the Minibuffer
  1639. ----------------------
  1640.  
  1641.     The minibuffer (i.e., the last line on the screen, aka the :-prompt)
  1642.     can be edited using arrow keys, the delete character, or by toggling to
  1643.     vi-mode with the ^G (mini-edit) character.  In mini-edit mode, you may
  1644.     use commands that do not move the cursor to a different line, as well
  1645.     as the following editing commands: i, a, I, A.
  1646.  
  1647.     Vile treats the minibuffer specially.  Completed lines are written
  1648.     to the history buffer.  When scrolling up/down in the command history,
  1649.     vile displays the data that correspond to the command which you have
  1650.     entered, e.g., a :set command will display the variables entered for
  1651.     preceding :set commands.
  1652.  
  1653. Special Character Expansion
  1654. ---------------------------
  1655.  
  1656.     As in vi, the % and # characters typed while responding to a prompt
  1657.     will expand to the current or "alternate" filename.
  1658.  
  1659.     Also as in vi, the ~ character will expand to be the previous
  1660.     replacement pattern when entering either a replacement or search
  1661.     pattern,
  1662.  
  1663.     In addition, the colon character (":") expands at most prompts to
  1664.     be the identifier name under the cursor.
  1665.  
  1666.     Expansion of ! to the last command run is implemented, but only
  1667.     when a shell command is being entered.
  1668.  
  1669.     Any of these expansions can be suppressed by prefixing with a '\'.
  1670.  
  1671. Key Rebinding
  1672. -------------
  1673.  
  1674.     There is a key rebinding facility (if vile is built to include it),
  1675.     which is invoked as follows.  One must know the "english" name for the
  1676.     command being rebound.  Use ":show-commands" or ":apropos string"
  1677.     to find english names containing "string".  Then use the command:
  1678.         ":bind-key englishname keyseq"
  1679.     where keyseq is the exact keyboard sequence (i.e. single character,
  1680.     or '^X', '^A', or '#' followed by a single character) to which the
  1681.     command should be bound.  In a .vilerc file, keyseq can be either
  1682.     the literal sequence, or the printable representation of the
  1683.     sequence, e.g. ^A-a or ^X-S.   (A summary of how key-sequences can
  1684.     be represented appears at the end of this section.)
  1685.  
  1686.     Commands can also be bound to meta keys, which are regular ASCII
  1687.     characters with the eighth bit (0x80) bit set.  The "printable"
  1688.     form for these keys is 'M-c'.
  1689.  
  1690.     Commands bound to '#-c' key sequences are usually also available
  1691.     by using the function keys on the terminal.  Thus the up-arrow
  1692.     function key can be bound to as '#-A'.
  1693.  
  1694.     Even the ^A and ^X prefix characters can be rebound, using the
  1695.     dummy functions "cntl_a-prefix" and "cntl_x-prefix", and the '#'
  1696.     key itself can be rebound -- it is represented by the command name
  1697.     "function-prefix".
  1698.  
  1699.     Examples:
  1700.      To cause the / and ? commands to perform incremental
  1701.       searches, use:
  1702.         bind-key incremental-search /
  1703.         bind-key reverse-incremental-search ?
  1704.      To make ^N and ^P switch windows instead of cause motion by lines,
  1705.        try:
  1706.         bind-key next-window ^N
  1707.         bind-key previous-window ^P
  1708.      To cause the space bar to move forward by pages, as in the "more"
  1709.       command, use:
  1710.         bind-key next-page \s
  1711.  
  1712.     (Space and tab can be represented with: "\s" and "\t".)
  1713.  
  1714.     Note that when interactive, ^A and ^X are typed using the control
  1715.     key.  In a file, however, they can be either a caret (^) followed
  1716.     by a letter, or the literal control key.  In the latter case you
  1717.     would not use the '-' separator.  So ^A-x as four distinct
  1718.     characters could also be entered as ^Ax, which would only be two
  1719.     characters.
  1720.  
  1721.     Characters can be entered in hex or octal as well, in the form
  1722.     0xNN, where NN is exactly two hex digits.  So if you know the hex
  1723.     value for a key, you can bind to it like:
  1724.         bind-key next-window ^A-\x14
  1725.     or
  1726.         bind-key next-window #-\213
  1727.  
  1728.     The sequence 'M-', represents a "meta-key", or a "meta" character.
  1729.     It is equivalent to setting the high bit of the following
  1730.     character, so 'M-e' is has the value of (0x80|0x65), or 0xe5.
  1731.  
  1732.     Function and meta-key bindings are available in insert mode, as
  1733.     well as in command mode.  (But only via either the "meta bit" or
  1734.     ESC sequence form -- the '#' prefix will not work in insert mode.)
  1735.     So the following macro will work correctly in both command and
  1736.     insert modes:
  1737.  
  1738.         15 store-macro
  1739.             insert-string "fprintf(stderr, \""
  1740.             set-named-mark z
  1741.             insert-string "\\n\");\n"
  1742.             goto-named-mark-exact z
  1743.             ; enter insert mode if we weren't already there
  1744.             ~if &seq $mode "command"
  1745.                 insert-chars
  1746.             ~endif
  1747.         ~endm
  1748.         ; bind to function key f
  1749.         bind-key execute-macro-15 #-f
  1750.         ; also bind to meta-A
  1751.         bind-key execute-macro-15 M-A
  1752.  
  1753.     Actually the "meta-insert-bindings" setting controls whether meta-
  1754.     keys will have their bound effect when in insert mode.  If this
  1755.     setting is not on (or if the meta-key is not bound to any function)
  1756.     then the key's value will simply be inserted into the buffer.
  1757.  
  1758.  
  1759.     Syntax for key-sequences:
  1760.     -------------------------
  1761.     To summarize, a key-sequence being bound to is specified with:
  1762.         1) an optional prefix, like this:
  1763.             ^A-    (three chars)
  1764.             ^X-    (three chars)
  1765.             ^A    (one char)
  1766.             ^X    (one char)
  1767.  
  1768.         2) followed by an optional "function" prefix:
  1769.             #-    (two chars) or
  1770.             FN-    (three chars)
  1771.  
  1772.         3) followed by an optional "meta" prefix:
  1773.             M-    (two chars)
  1774.             (this is the same as with specifying a character
  1775.                 in that has the high bit set)
  1776.  
  1777.         4) followed by a character, like this:
  1778.             C    (one char)
  1779.             ^C    (one char)
  1780.             ^C    (two chars)
  1781.             \NNN    (max of four chars, where NNN are octal digits)
  1782.             \xNN    (max of four chars, where NN are hex digits)
  1783.             \n,\r,\t,\b,\f,\a (two chars each, usual meanings)
  1784.             \e    (two chars, means ESC)
  1785.             \s    (two chars, means SPACE)
  1786.  
  1787.     (The "one char" control character entries in the above table are
  1788.     represented in this help file as two printable characters, to
  1789.     ensure they are not deleted by mailers or file transfer programs.)
  1790.  
  1791.     Function Keys
  1792.     -------------
  1793.     When you bind to a function key, you will see its value printed
  1794.     as a 'poundsign' sequence.  And, if you wish to :map a function
  1795.     key, you will need to use its poundsign sequence.  This is
  1796.     explained more fully below.
  1797.  
  1798.     The list of function key labels, along with their "vile name",
  1799.     are as follows:
  1800.  
  1801.        Usual Label    Vile name     Usual Label    Vile name
  1802.        -----------    ---------     -----------    ---------
  1803.         Up-arrow        #A          Home            #H
  1804.         Down-arrow      #B          End             #E
  1805.         Left-arrow      #D          Insert          #i
  1806.         Right-arrow     #C          Delete          #d
  1807.         Prior (PageUp)  #p          Find            #f
  1808.         Next (PageDown) #n          Select          #s
  1809.         Help            #?        Menu            #m
  1810.         F1              #1          F12             #@
  1811.         F2              #2          F13             ##
  1812.         F3              #3          F14             #$
  1813.         F4              #4          F15             #%
  1814.         F5              #5          F16             #^
  1815.         F6              #6          F17             #&
  1816.         F7              #7          F18             #*
  1817.         F8              #8          F19             #(
  1818.         F9              #9          F20             #)
  1819.         F10             #0          F11             #!
  1820.         KeyPad_F1       #P          KeyPad_F3   #R
  1821.         KeyPad_F2       #Q          KeyPad_F4   #S
  1822.  
  1823.         In addition, #M, #t, and #T are used internally to support
  1824.         mouse operations in an xterm.  To undo the relationship
  1825.         between a "system-defined" function key and the poundsign
  1826.         sequence it produces, use ":unmap-system-chars".
  1827.  
  1828.  
  1829.     :map, :map!, :noremap, :noremap!
  1830.     ---------------------------------
  1831.     The vi "map" and "map!" commands are implemented in vile.  As in
  1832.     vi, mapping works best if the character sequence being bound
  1833.     corresponds to pressing a single key.  Multiple key sequences will
  1834.     work as long as the next key in the sequence is pressed within a
  1835.     specified number of milliseconds.  The value of "timeoutlen" is
  1836.     used for system-defined character sequences, i.e. function keys.
  1837.     User defined sequences will use this too, unless the value of
  1838.     "timeoutlen-user" is non-zero, in which case this value will be
  1839.     used instead.
  1840.  
  1841.     Because "map" and "map!" may be used to remap arbitrary sequences,
  1842.     these sequences must be entered literally, i.e, the syntax for
  1843.     key sequences as listed above will not work for "map" and "map!".
  1844.     To enter control characters into a .vilerc file, use the ^V escaping
  1845.     mechanism.  A map command entered from the command line will require
  1846.     fewer characters be escaped with ^V.
  1847.  
  1848.     To provide a relatively portable way of specifying function key
  1849.     mappings, vile will reapply mapping to the result of a system-
  1850.     defined map.  System function keys are mapped to "poundsign"
  1851.     sequences, like '#1' for function key 1, and '#B' for the down-arrow
  1852.     key.  The remapping allows one to put
  1853.         map #1 <some-user-map-sequence>
  1854.     in the .vilerc file, and have the user-sequence executed when the
  1855.     system F1 key is pressed.  (Otherwise the terminal-specific
  1856.     sequence would have to appear in the .vilerc.)  See the section
  1857.     on "Function Keys" above for a full list.
  1858.  
  1859.     The "remap" option controls whether the successfully mapped result
  1860.     of a map is reevaluated for more mapping matches.  The "noremap" (and
  1861.     "noremap!") variants of the map commands will force that particular
  1862.     mapping to be applied without subsequent remapping, regardless of
  1863.     the current setting of the global "remap" setting.
  1864.  
  1865.     Since key sequences starting the '^X', '^A', or '#' prefixes
  1866.     are normally expected to act as a unit, no remapping is done on
  1867.     characters that follow such prefixes.  For instance, this keeps a
  1868.     map like:
  1869.         :map h ihello<ESC>
  1870.     from breaking the '^X-h' command.
  1871.  
  1872.     Long running loops caused by recursive :map definitions are
  1873.     detected and assumed to be infinite.  When such a loop is detected,
  1874.     execution is aborted.  Turning off the "remap" option, or doing
  1875.     some of the maps with the ":noremap/:noremap!" form of the map
  1876.     commands will eliminate most such loops.
  1877.  
  1878.     vile normally duplicates real vi's behavior (but not vim's) in that
  1879.     the first character of the sequence being mapped to is not subject
  1880.     to recursive (map) evaluation.  Assuming "remap" is on, pressing
  1881.     'j' when ":map j jh" is in effect will not cause an infinite loop,
  1882.     whereas ":map j hj" _will_ cause such a loop.  Setting the
  1883.     "remapfirst" option will allow this sort of remapping (and will
  1884.     cause an infinite loops for both examples).
  1885.  
  1886.     The "maplonger" option controls whether the longer or shorter of
  1887.     two "nested" map strings will be favored by the editor.  That is,
  1888.     if both "foo" and "foobar" are mapped (to presumably different
  1889.     values), then with "maplonger" set, vile will not expand "foo" until
  1890.     it is sure (either because the next character is not 'b', or a
  1891.     timeout has expired) that "foobar" will not be seen.  Real vi will
  1892.     always expand "foo" immediately, and this is the default behavior.
  1893.     Though not particularly recommended, the "maplonger" mechanism even
  1894.     permits the following types of mappings:
  1895.  
  1896.         :map z j
  1897.         :map zz k
  1898.  
  1899.     When 'z' is pressed by itself it will cause vile to move down one
  1900.     line (assuming j has not been rebound or remapped).  But if 'z' is
  1901.     pressed twice rapidly (enough) in succession, vile will move to the
  1902.     previous line.
  1903.  
  1904.     The left hand side of a map[!] definition may contain the usual
  1905.     backslash escapes:  \n, \r, \t, \b, \f, \a (^G), \e (ESC),
  1906.     \s (SPACE), \xNN (hex), \NNN (octal).  The right hand side is
  1907.     taken exactly literally, so special characters must be expressed
  1908.     as themselves.
  1909.  
  1910.     The current set of mappings or "map!"ings may be viewed with
  1911.     the commands ":map<CR>" (or ":show-mapped-chars") or ":map!<CR>"
  1912.     (or ":show-mapped!-chars").
  1913.  
  1914.     The system-defined maps, representing the function keys, may be
  1915.     shown with ":show-system-mapped-chars".
  1916.  
  1917.     To undo a mapping, use "unmap", "unmap!", or "unmap-system-chars".
  1918.  
  1919.     :abbr
  1920.     ------
  1921.     The "abbr" command is also present in vile.  It is similar to, but
  1922.     slightly different than, "map!".  Whereas "map!" examines
  1923.     characters as they are typed, continuously looking for a match
  1924.     against the stored translation strings, the "abbr" command examines
  1925.     them after they are already in the buffer, and is more sensitive to
  1926.     their surrounding context.
  1927.  
  1928.     First, abbreviations are never expanded unless followed by
  1929.     non-"word" characters.  In addition, abbreviations which begin like
  1930.     a "word" (i.e. with letters, digits, or the '_' character) are not
  1931.     expanded if they immediately follow another "word" character --
  1932.     they must follow whitespace or punctuation or the beginning of the
  1933.     line.  Likewise, abbreviations that begin with a punctuation
  1934.     character are not detected within more punctuation -- they must
  1935.     follow whitespace or a "word", or the beginning of the line.
  1936.  
  1937.     If the "backspacelimit" setting is set (and it is, by default),
  1938.     then characters not inserted during the current insertion command
  1939.     are not considered in the above comparisons -- the start of the
  1940.     current insertion behaves much like the beginning of line in that
  1941.     case.
  1942.  
  1943.     Abbreviations are never recursive.
  1944.  
  1945.     vile is more lenient than vi regarding what is a valid
  1946.     abbreviation.  vi insists that an abbreviation be all "word"
  1947.     characters, or be all "non-word" characters, except for the last
  1948.     character, which _must_ be a "word" character.  vile allows
  1949.     anything at all to be abbreviated, only enforcing the expansion
  1950.     rules mentioned above.
  1951.  
  1952.     To undo an abbreviation, use "unabbreviate".
  1953.  
  1954. Special "Terminal" Key Rebinding
  1955. --------------------------------
  1956.  
  1957.     In addition to the above binding mechanism for vile commands, other
  1958.     keystrokes to the editor are rebindable using the "set-terminal"
  1959.     command.  These keystrokes are mostly derived directly from the
  1960.     user's tty settings on entering the editor, but there are a couple
  1961.     of additions related to command and filename completion.
  1962.  
  1963.     The values of these characters can be shown with the "show-terminal"
  1964.     command, and can be changed with the "set-terminal" command.
  1965.  
  1966.                 Default value        Typical value
  1967.     -------------------------------------------------------------
  1968.     backspace        from tty settings    (DEL or ^H)
  1969.     interrupt        from tty settings    (^C or DEL)
  1970.     line-kill        from tty settings    (^U or @)
  1971.     mini-edit        (^G)
  1972.     name-complete        <tab>
  1973.     quote-next        from tty settings    (^V)
  1974.     start-output        from tty settings    (^Q)
  1975.     stop-output        from tty settings    (^S)
  1976.     suspend            from tty settings    (^Z)
  1977.     test-completions    ?
  1978.     word-kill        from tty settings    (^W)
  1979.  
  1980. Flow-control
  1981. ------------
  1982.     Historically, the flow of data between the computing host and the
  1983.     user's terminal was throttled through the use of special characters
  1984.     in the input stream, known as XON and XOFF (whose values are ^Q and
  1985.     ^S respectively).  Most modern systems do not need these
  1986.     characters, and regulate the flow in an "out-of-band" manner.  The
  1987.     terminal device driver, however, is usually still set up with
  1988.     software flow control enabled, to allow the user to manually start
  1989.     and stop output with the ^S and ^Q characters.
  1990.  
  1991.     vile normally resets the driver to allow the ^S and ^Q characters
  1992.     to be bound to commands, since most systems no longer need software
  1993.     flow control, and since there is usually no reason for a user to
  1994.     wish to suspend output when running vile.  Some older devices
  1995.     (usually older slower terminals), however, still need to be able to
  1996.     automatically control the data flow by generating ^S/^Q without the
  1997.     user's intervention.
  1998.  
  1999.     To accommodate these situations, the "flow-control-enable" command
  2000.     will reset the terminal driver to its original state.  Software
  2001.     flow-control will be re-enabled, and commands bound only to the ^S
  2002.     and ^Q characters will be inaccessible.  The characters affected
  2003.     in this way may be seen with the "show-terminal-chars" command,
  2004.     where they will appear as the "start/stop-output" characters.
  2005.     The action of the "flow-control-enable" command will be reversed
  2006.     if it is given any argument.
  2007.  
  2008. Recorded macros
  2009. ---------------
  2010.  
  2011.     The first type of macro in vile is for temporary, quick macro
  2012.     usage, and lets you record a macro as you execute vile commands.
  2013.     You can then replay those keystrokes with a single key.
  2014.  
  2015.     ^X-(    Begin recording a keyboard macro.  The keystrokes you type
  2016.         are recorded, until you use ^X-).
  2017.     ^X-)    Finish recording a keyboard macro.
  2018.     ^X-&    Execute the keyboard macro.
  2019.     ^X-^    Copy recorded keyboard macro to a named register, for saving,
  2020.         or for execution using '@a', as below.  (Type "a^X^ )
  2021.  
  2022.     The vi '@' command is present as well, and can be used to execute
  2023.     the contents of a named register as if it were entered at the
  2024.     keyboard.  To make this more useful, the "load-register" command
  2025.     will allow preloading a named register, from .vilerc file.  For
  2026.     example:
  2027.         use-register a load-register ihello^[
  2028.     will load register 'a' with a command to insert the word "hello".
  2029.     (The ^[ should be a real ESC character, entered by preceding it
  2030.     with ^V.)  A better example, is this:
  2031.         use-register w load-register ":!chmod +w %^M:w^M"
  2032.     which makes the current file writable and writes it.  (Again, use
  2033.     ^V to get the CR characters into the .vilerc file.)
  2034.  
  2035. Programmed procedures and macros
  2036. --------------------------------
  2037.  
  2038.     [ For more/different information on programmed macros, refer
  2039.     to the file "macros.doc", supplied with the vile source code. ]
  2040.  
  2041.     vile can also be extended by defining macros and then binding
  2042.     the execution of those macros to key sequences.  For instance, if
  2043.     the following lines appear in a .vilerc file:
  2044.         1 store-macro
  2045.          5 delete-til next-word
  2046.         ~endm
  2047.         bind-key execute-macro-1 ^A-1
  2048.     then when ^A-1 is executed, 5 words will be deleted.  The "-til"
  2049.     suffix on an englishname denotes that it is a vi operator style
  2050.     command, and expects to be followed by a motion command.  Also,
  2051.         1 store-macro
  2052.          5 delete-til lines
  2053.         ~endm
  2054.     would be the equivalent of "5dd" since the word "lines" represents
  2055.     the stuttered 'dd' style of operation.  More examples are given
  2056.     down below.
  2057.  
  2058.     Variables
  2059.     ---------
  2060.     There are some built-in variables that can be used in macros to gain
  2061.     access to parts of vile status, and parts of the current buffer.
  2062.     Built-in variables are accessed by name, prefixed with the '$'
  2063.     character.  There are two types of built-in variables (the environment
  2064.     variables, and mode values).  The environment variables are:
  2065.  
  2066.     $abufname    alternate buffer name (i.e. last visited)
  2067.     $bchars        number of characters in current buffer    (read only)
  2068.     $blines        number of lines in current buffer    (read only)
  2069.     $buffer-hook    name of procedure to run when switching to a buffer
  2070.     $cbufname    current buffer name
  2071.     $cd-hook    name of procedure to run when changing directories
  2072.     $cfilname    current file name
  2073.     $char        character under the cursor
  2074.     $cryptkey    encryption key                (write only)
  2075.     $curcol        current column position of cursor
  2076.     $curline    current line in file
  2077.     $cwd        current directory
  2078.     $cwline        line offset in current window
  2079.     $debug        macro debugging -- set true for line by line tracing
  2080.     $directory    controls location of temp-files
  2081.     $discmd        display commands on command line
  2082.     $disinp        display command line input characters
  2083.     $end-of-cmd    true if user ended the cmd with <CR>
  2084.     $exit-hook    name of procedure to run when quitting
  2085.     $flicker    set true to suppress CGA flicker on a PC.  ugh.
  2086.     $font        current font name (X11/winvile versions only)
  2087.     $forward-search    search direction, true=forward
  2088.     $helpfile    help-filename (vile.hlp)
  2089.     $iconname    current icon name (X11 version only)
  2090.     $identifier    current punctuated word
  2091.     $kill        some of the kill register        (read only)
  2092.     $lastkey    last keyboard char struck
  2093.     $line        text of current line
  2094.     $llength    length of current line            (read only)
  2095.     $majormode    current majormode, if any        (read only)
  2096.     $match        last matched magic pattern        (read only)
  2097.     $mode        current mode ("command","insert","overwrite") (rd. o.)
  2098.     $modeline-format format of mode lines.  see "Mode line customization".
  2099.     $modified    is current buffer modified or not?
  2100.     $ntildes    percent of window filled by ~ chars, at end of buffer
  2101.     $ocwd        previous directory            (read only)
  2102.     $os        "unix", "dos", "vms", "os/2", "win32"    (read only)
  2103.     $pagelen    number of screen lines in use by editor
  2104.     $pagewid    current screen width
  2105.     $palette    current palette string
  2106.     $patchlevel    current patch-level (empty for release)
  2107.     $pathname    current path-like word
  2108.     $pending    typeahead pending flag            (read only)
  2109.     $pid        returns vile's process-id        (read only)
  2110.     $progname    returns "vile" or "xvile" or "winvile".    (read only)
  2111.     $qidentifier    current qualified name (as with C++ ::)
  2112.     $read-hook    name of procedure to run after a file is read
  2113.     $replace    replacement pattern
  2114.     $search        search pattern
  2115.     $seed        current random number seed
  2116.     $shell        name of the shell program for spawned commands.
  2117.     $sres        current screen resolution
  2118.     $status        returns the status of the last command
  2119.     $title        current window title (X11 version only)
  2120.     $tpause        length to pause for paren matching (PC versions)
  2121.     $version    current version number            (read only)
  2122.     $wlines        number of lines in current window
  2123.     $word        current "word"
  2124.     $write-hook    name of procedure to run before a file is written
  2125.     $xdisplay    the value to set $DISPLAY when running $xshell.
  2126.     $xshell        name of the terminal program for spawned xvile commands.
  2127.  
  2128.     In addition to the environment variables, you may set and use the
  2129.     values of the editor modes (i.e., universal modes, buffer-only modes or
  2130.     window-only modes), e.g., "setv $dos=true".  The global values of the
  2131.     editor modes are not visible to the expression evaluator.
  2132.  
  2133.     User-defined variables can also be set and used; their names are
  2134.     prefixed with the '%' character.
  2135.  
  2136.     Response variables (a '@' followed by a prompt-string) cause vile to
  2137.     prompt for input with the given prompt-string.
  2138.  
  2139.     Buffer variables (a '<' followed by a buffer name) return the current
  2140.     line of the specified buffer, automatically setting the position to the
  2141.     next line.
  2142.  
  2143.     Functions
  2144.     ---------
  2145.     There are also functions available, which can act on those variables,
  2146.     or on hard-coded values.  Operations are expressed in prefix notation,
  2147.     so to add to numbers you would say "&add 3 5".
  2148.  
  2149.     func    no. of
  2150.     name    args
  2151.     --------------
  2152.     &add    2    add two numbers together
  2153.     &sub    2    subtraction
  2154.     &tim    2    multiplication
  2155.     &div    2    division
  2156.     &mod    2    modulus
  2157.     &neg    1    negate
  2158.     &cat    2    concatenate string
  2159.     &lef    2    left string(string, len)
  2160.     &rig    2    right string(string, pos)
  2161.     &mid    3    mid string(string, pos, len)
  2162.     ¬    1    logical not
  2163.     &equ    2    logical equality
  2164.     &les    2    logical less than
  2165.     &gre    2    logical greater than
  2166.     &seq    2    string logical equality check
  2167.     &sle    2    string logical less than
  2168.     &sgr    2    string logical greater than
  2169.     &ind    1    evaluate indirect value
  2170.     &and    2    logical and
  2171.     &or     2    logical or
  2172.     &len    1    string length
  2173.     &upp    1    uppercase string
  2174.     &low    1    lower case string
  2175.     &tri    1    trim whitespace from string
  2176.     &tru    1    Truth of the universe logical test
  2177.     &asc    1    char to integer conversion
  2178.     &chr    1    integer to char conversion
  2179.     >k    0    get 1 character
  2180.     >s    0    get keycode sequence, e.g., #1
  2181.     &rnd    1    get a random number from 1 to n
  2182.     &abs    1    absolute value of a number
  2183.     &sin    2    find the index of second string in first
  2184.     &env    1    retrieve a system environment variable
  2185.     &bin    1    lookup what function name is bound to key
  2186.     &rd    1    is a file readable
  2187.     &wr    1    is a file writable
  2188.     &glo    1    retrieves global mode setting
  2189.     &loc    1    retrieves local mode setting
  2190.  
  2191.  
  2192.     Directives
  2193.     ----------
  2194.     Primitive flow-of-control within a macro may be obtained with
  2195.     certain directives.  Macro directives start with a "~" and include
  2196.     the following:  (see the file macros.doc for more detail)
  2197.  
  2198.     ~if cond    conditional execution
  2199.     ~elseif cond    conditional execution
  2200.     ~else
  2201.     ~endif
  2202.     ~return        Return (terminating current macro)
  2203.     ~goto label    Jump to a label in the current macro
  2204.     ~force        Force macro to continue...even if command fails
  2205.     ~while cond    Execute a loop if the condition is true
  2206.     ~break
  2207.     ~endwhile
  2208.  
  2209.     ~endm        End a macro
  2210.  
  2211.     Line Labels begin with a "*" as the first nonblank char, like:
  2212.  
  2213.     *LBL01
  2214.  
  2215.     (you would jump to this with:
  2216.         ~goto LBL01
  2217.     )
  2218.  
  2219.     Lines ending with '\' are joined before interpreting them.
  2220.  
  2221.     Procedures vs. Macros
  2222.     ---------------------
  2223.     Macros are really just a special use of stored "procedures", which
  2224.     are, in turn, really just a special "type" of buffer.  To execute
  2225.     the contents of a buffer, it needs to have a name of the form
  2226.     "[buffername]".  Then, it can be executed as a procedure with the
  2227.     "run" command, as in "run buffername".  The best way to get
  2228.     procedures into buffers named that way (and also to make them
  2229.     invisible, so they don't clutter the buffer list) is to use
  2230.     the "store-procedure" command:
  2231.  
  2232.         store-procedure my_cd_action
  2233.         write-message &cat &cat &cat "moved from " $ocwd " to " $cwd
  2234.         ~if &seq $progname "xvile"
  2235.             set title $cwd
  2236.         ~endif
  2237.         ~endm
  2238.  
  2239.     Macros are a special usage of procedures, which are bindable to
  2240.     keystrokes (i.e. if procedures could be bound directly to keys,
  2241.     then macros would be redundant).  When the "9 store-macro" command
  2242.     is used, it creates a procedure whose name is [Macro 9], where 9
  2243.     is the argument to "store-macro".  This can then be executed
  2244.     with either
  2245.         run "Macro 9"
  2246.     or
  2247.         execute-macro-9
  2248.     Most of the examples given below use the macro form of definition,
  2249.     since one most often wants to bind macros to keys.
  2250.  
  2251.     Hooks
  2252.     -----
  2253.     There are a few places within vile where a user-specifiable
  2254.     procedure will be executed if desired.  These points are referred
  2255.     to as "hooks".  Hooks are specified by special variables which
  2256.     hold the name of a procedure to run at that point in the code.
  2257.     For instance, there is a "cd-hook", which is run when you change
  2258.     directories.  So, using the "my_cd_action" example given above,
  2259.     if the line
  2260.         set cd-hook my_cd_action
  2261.     is added, then that procedure will print a message and, under
  2262.     xvile, change the window title when the current directory is
  2263.     changed.
  2264.  
  2265.     The following hooks are currently implemented:
  2266.     $buffer-hook    run when switching to a buffer
  2267.     $cd-hook    run when changing directories
  2268.     $exit-hook    run when quitting
  2269.     $read-hook    run after a file is read
  2270.     $write-hook    run before a file is written
  2271.  
  2272.     Be careful with "buffer-hook".  Executing commands in the hook
  2273.     which themselves switch buffers is not recommended.  In general,
  2274.     all the hooks are a little dangerous, since vile has not been
  2275.     written with re-entrancy foremost in mind.  One should avoid putting
  2276.     actions in hooks which might cause the hook to be re-executed.
  2277.     (vile keeps the hook procedure itself from being re-executed, to
  2278.     prevent recursion, but the code surrounding the call to it may not
  2279.     be safe either.)
  2280.  
  2281.     Macro examples
  2282.     --------------
  2283.     To prevent vile from thinking that a failed command is an error in
  2284.     the macro, you can put "~force" in front of it.  So, to write a
  2285.     macro which will run the "man" command on the identifier under the
  2286.     cursor, where you don't really consider it an error if the command
  2287.     fails, you might use:
  2288.  
  2289.         9 store-macro
  2290.             ~force 1 shell-command &cat "man " $identifier
  2291.         ~endm
  2292.         bind-key execute-macro-9 ^X-m
  2293.  
  2294.     (The argument '1' suppresses the "press return" prompt which
  2295.     normally appears after a command runs, since man runs a pager
  2296.     which does this anyway.)
  2297.  
  2298.     The "screen-search-forward" command could be re-implemented as:
  2299.         10 store-macro
  2300.             ~force search-forward $identifier
  2301.         ~endm
  2302.         bind-key execute-macro-10 ^X-/
  2303.  
  2304.     And the "screen-search-pattern-grab" command, normally bound to
  2305.     ^A-/, could be implemented with:
  2306.         11 store-macro
  2307.             set-variable $search $identifier
  2308.             write-message &cat "Search pattern is now " $search
  2309.         ~endm
  2310.         bind-key execute-macro-11 ^A-/
  2311.  
  2312.     A variation, which will not find the identifier if it is a substring
  2313.     of another word, is:
  2314.         12 store-macro
  2315.             ~force search-forward &cat "\\<" &cat $identifier "\\>"
  2316.         ~endm
  2317.     This works by surrounding the string with the \< and \> regular
  2318.     expression metacharacters.
  2319.  
  2320.  
  2321.     Here's another example, which finds C++ qualified identifiers, and
  2322.     uses them for a tag lookup:
  2323.         * Implement  ^A-^] for qualified-name tag lookup
  2324.         24 store-macro
  2325.             backward-character
  2326.             set-variable %osearch $search
  2327.             search-forward "^[a-zA-Z_][a-zA-Z0-9_:]*"
  2328.             set-variable $search %osearch
  2329.             set-variable %osearch ""
  2330.             write-message &cat "Tag pattern is now " $match
  2331.             ~force find-tag $match
  2332.         ~endm
  2333.         bind-key execute-macro-24 ^A-^]
  2334.     (The "backward-character" is needed because "search-forward" will
  2335.     always skip the cursor position when scanning, so as to always find
  2336.     the next occurrence.  The user variable %osearch is used so as not
  2337.     to disturb the search string.)
  2338.  
  2339.     Note that for simple key-remappings, binding is often preferable
  2340.     to creating a macro.  Some people prefer using lower-case 'g' to
  2341.     as an equivalent to 'G', to goto a specific line.  If done as a
  2342.     macro, like this:
  2343.  
  2344.         3 store-macro
  2345.             goto-line
  2346.         ~endm
  2347.         bind-key execute-macro-3 g
  2348.  
  2349.     then both g and G go to the end of the file, but whereas 1000G goes
  2350.     to line 1000, 1000g goes to the end of the file 1000 times.  It is
  2351.     easier (and more correct) to do:
  2352.  
  2353.         bind-key goto-line g
  2354.  
  2355.     A couple more examples of slightly more complex macros:
  2356.     They cause a jump to the next (or previous) line of the same (or
  2357.     lesser) indent, skipping over empty lines.  (Thanks to MIURA Masahiro)
  2358.  
  2359.     ; macro 1 - back to the line of same indent
  2360.     ;
  2361.     1 store-macro
  2362.         first-nonwhite
  2363.         set-variable %indlev $curcol
  2364.         ~force back-line-at-bol
  2365.         ~if &seq &trim $line ""
  2366.             ~goto L1
  2367.         ~endif
  2368.         ~while &les %indlev $curcol
  2369.             *L1
  2370.             ~force back-line-at-bol
  2371.             ~if &seq $status "FALSE"
  2372.                 ~return
  2373.             ~endif
  2374.             ~if &seq &trim $line ""
  2375.                 ~goto L1
  2376.             ~endif
  2377.         ~endwhile
  2378.     ~endm
  2379.     bind-key execute-macro-1 ^X-[
  2380.  
  2381.     ; macro 2 - forward to the line of same indent
  2382.     ;
  2383.     2 store-macro
  2384.         first-nonwhite
  2385.         set-variable %indlev $curcol
  2386.         ~force down-line-at-bol
  2387.         ~if &seq &trim $line ""
  2388.             ~goto L2
  2389.         ~endif
  2390.         ~while &les %indlev $curcol
  2391.             *L2
  2392.             ~force down-line-at-bol
  2393.             ~if &seq $status "FALSE"
  2394.                 ~return
  2395.             ~endif
  2396.             ~if &seq &trim $line ""
  2397.                 ~goto L2
  2398.             ~endif
  2399.         ~endwhile
  2400.     ~endm
  2401.     bind-key execute-macro-2 ^X-]
  2402.  
  2403.     ; macro 14 - grep for the word under the cursor, and put the result
  2404.     ;    in a buffer named after that word.  set the error-buffer,
  2405.     ;    so that ^X-^X may be used to visit the lines found by grep.
  2406.     ;    (we have to set error-buffer explicitly, since we renamed
  2407.     ;    the buffer -- otherwise it tracks the last pipe read by vile)
  2408.     14 store-macro
  2409.         set-variable %grepfor $identifier
  2410.         edit-file &cat "!egrep -n " &cat %grepfor " *.[chs]"
  2411.         rename-buffer %grepfor
  2412.         error-buffer %grepfor
  2413.     ~endm
  2414.     bind-key execute-macro-14 ^A-g
  2415.  
  2416.     As a hint, it is (almost?) never correct to write a ':' command
  2417.     when creating a programmed macro.  For instance, if you find
  2418.     yourself writing something like:
  2419.  
  2420.         &cat ":!chmod +w " $cfilname
  2421.         &cat ":e! " $cfilname
  2422.  
  2423.     (in an attempt to make a buffer writable before editing it), then
  2424.     what you really want is:
  2425.  
  2426.         shell-command &cat "chmod +w " $cfilname
  2427.         replace-with-file $cfilname
  2428.  
  2429.     Furthermore, some things are just as easy if done with a
  2430.     "keystroke" macro rather than a programmed macro:
  2431.  
  2432.         ; use this as '@w'
  2433.         use-register w load-register ":!chmod +w %^M:setl noview^M:w^M"
  2434.  
  2435.     or
  2436.  
  2437.         map ^A-w ":!chmod +w %^M:setl noview^M:w^M"
  2438.  
  2439.     (Of course you need to replace the ^M's with real carriage-returns.)
  2440.  
  2441.     Picture Mode
  2442.     ------------
  2443.     Another example of a fairly complex vile procedure can be found
  2444.     in the file "pictmode.rc".  The code there implements a primitive
  2445.     means of drawing "ASCII art":
  2446.  
  2447.         o----------------------------------------o
  2448.            /----------------------------------------/|
  2449.           o----------------------------------------o||
  2450.           | To use it, first ":source pictmode.rc" |||
  2451.           | and then "run pic".  See the comments  |||
  2452.           | at the top of pictmode.rc for more     ||o
  2453.           | information...                   |/
  2454.           o----------------------------------------o
  2455.  
  2456. Regular Expressions
  2457. -------------------
  2458.  
  2459.     Searches use regular expressions, which, as in vi, may be magic
  2460.     by default or not.
  2461.  
  2462.     vile introduces some new magic metacharacters.
  2463.  
  2464.     The code that implements the expressions is based directly on
  2465.     Henry Spencer's regexp code.  Quoting from the original man page:
  2466.  
  2467.     [For ease of reference, the metacharacters are noted in the margin.)
  2468.  
  2469.    \|    "A regular expression is zero or more branches, separated by `\|'.
  2470.     It matches anything that matches one of the branches."
  2471.  
  2472.     "A branch is zero or more pieces, concatenated.  It matches a match
  2473.     for the first, followed by a match for the second, etc."
  2474.  
  2475.     "A piece is an atom possibly followed by `*', `\+', or `\?'.  An atom
  2476.    *    followed by `*' matches a sequence of 0 or more matches of the
  2477.    +    atom.  An atom followed by `\+' matches a sequence of 1 or more
  2478.    \?    matches of the atom.  An atom followed by `\?' matches a match of
  2479.     the atom, or the null string." [i.e., `\?' matches 0 or 1 occurrences]
  2480.  
  2481.  \( \)    "An atom is a regular expression in backslashed parentheses
  2482.     (matching a match for the regular expression), a range (see below),
  2483.   . ^    `.' (matching any single character), `^' (matching the null string
  2484.    $    at the beginning of the input string), `$' (matching the null
  2485.    \c    string at the end of the input string), a `\' followed by a single
  2486.    c    character (matching that character), or a single character with no
  2487.     other significance (matching that character)."
  2488.  
  2489.  \< \>    In addition, vile atoms may be: \< and \>, which match the
  2490.  \s \S    beginning and end of a "word", \s and \S, which match characters of
  2491.  \w \W    whitespace and "darkspace", \w and \W, which match alphanumerics
  2492.  \d \D    (including '_') and non-alphanumerics, \d and \D, which match
  2493.  \p \P    digits and non-digits, and \p and \P, which match printable and
  2494.     non-printable characters (whitespace is printable).
  2495.  
  2496.  [ ]    "A range is a sequence of characters enclosed in `[]'.  It normally
  2497.     matches any single character from the sequence.  If the sequence
  2498.     begins with `^', it matches any single character not from the
  2499.     rest of the sequence.  If two characters in the sequence are
  2500.     separated by `-', this is shorthand for the full list of ASCII
  2501.     characters between them (e.g.  `[0-9]' matches any decimal digit).
  2502.     To include a literal `]' in the sequence, make it the first
  2503.     character (following a possible `^').  To include a literal `-',
  2504.     make it the first or last character."
  2505.  
  2506.     Additionally for vile, if "ignorecase" is set, then all literal
  2507.     matches, including those in character classes, are done without
  2508.     regard to upper and lower case.
  2509.  
  2510.     In magic mode, the following set of metacharacters
  2511.     must be preceded by '\' to hide their special meaning:
  2512.         * [ . ^ $
  2513.     These characters are special if they _are_ preceded with a '\':
  2514.         ? + ( ) | < >
  2515.  
  2516.     If magic mode is _not_ on, only ^ and $ are special if not escaped.
  2517.     All of the following must be preceded with a '\' to be special,
  2518.     otherwise they are taken literally:
  2519.         ? + ( ) | * [ . < >
  2520.  
  2521.     Replacement subexpressions are supported when substituting.  That
  2522.     is, if part of an expression is contained in \( and \), then the
  2523.     part of the matched text in between those symbols will be
  2524.  \1 \9    substituted for an occurrence of \1 in the replacement pattern.  Up
  2525.     to 9 such substitutions can be made.  The special symbol & will
  2526.   &    substitute for the entire match string.
  2527.  
  2528.   ~    The tilde (~) character will expand immediately when it is typed
  2529.     to be the contents of the previously entered replacement pattern.
  2530.     [ Earlier versions of vile made this version of the pattern
  2531.     available immediately, as a default response, but this made it
  2532.     difficult to substitute nothing after previously substituting
  2533.     something.  ]
  2534.  
  2535.     The replacement part of the substitution may also contain the
  2536.  \U \L    special sequences \U and \L, which cause the replacement to be
  2537.  \E    forced to uppercase or lowercase until a terminating \E is found;
  2538.  \u \l    \u and \l, which force the case of a single character; and \b,
  2539.  \bfrtn    \f, \r, \t, \n, which insert the usual ASCII character.
  2540.     Note that vile mimics perl's handling of \u\L\1\E instead of vi's.
  2541.     Given :s/\(abc\)/\u\L\1\E/ vi will replace with "abc" whereas vile
  2542.     and perl will replace with "Abc".  This is somewhat more useful for
  2543.     capitalizing words.
  2544.  
  2545. Command files
  2546. -------------
  2547.  
  2548.     On startup (in the absence of '@' arguments -- see Invocation
  2549.     below), vile will attempt to read the file ".vilerc" in the current
  2550.     directory, and then in $HOME, and will execute the commands found
  2551.     therein.  [This file is called "vile.rc" under DOS, and is searched
  2552.     for in the current directory and along the PATH.]  It is possible to
  2553.     nest such executions.  For example, you might keep your general
  2554.     default settings in your home directory, and put the following
  2555.     lines in a .vilerc in a directory in which you prefer tabs be set
  2556.     to 4 spaces:
  2557.  
  2558.         source "$HOME/.vilerc"
  2559.         set tabstop 8
  2560.  
  2561.     The quotes surrounding the filename are necessary to protect the
  2562.     name from interpretation as a vile variable, since it starts with
  2563.     the '$' character.
  2564.  
  2565.     Files can be executed at any time with the ":source" (or
  2566.     ":execute-file") command.  There are control structures available,
  2567.     such as ~while, ~if, etc.  Refer to the file macros.doc which
  2568.     is distributed with vile for more information.
  2569.  
  2570.     Nesting of source'd files is limited to a depth of ten, to prevent
  2571.     infinite recursion.
  2572.  
  2573.     The ';' character can be used as a comment character in command
  2574.     files, but not necessarily on the same line as valid commands.  Put
  2575.     your comments on separate lines to be safe.
  2576.  
  2577. Invocation
  2578. ----------
  2579.  
  2580.     As mentioned above, vile normally looks for files called "./.vilerc"
  2581.     and "$HOME/.vilerc", and executes the first one found.  If the
  2582.     variable VILEINIT is set in the environment, it is used as a set of
  2583.     vile commands to initialize the editor.  As a not-very-useful
  2584.     example of a VILEINIT sequence, the following setting will exactly
  2585.     recreate the default (i.e. no VILEINIT variable) behavior:
  2586.  
  2587.         export VILEINIT
  2588.         VILEINIT="
  2589.         ~if &rd \"./.vilerc\"
  2590.             source \"./.vilerc\"
  2591.         ~else
  2592.             ~if &rd \"$HOME/.vilerc\"
  2593.                 source \"$HOME/.vilerc\"
  2594.             ~endif
  2595.         ~endif"
  2596.  
  2597.     Other environment variables:
  2598.  
  2599.     VILE_HELP_FILE
  2600.         override the name of the help file, normally "vile.hlp".
  2601.     VILE_STARTUP_FILE
  2602.         override the name of the startup file, normally ".vilerc"
  2603.         (or "vile.rc" for non-UNIX systems).
  2604.     VILE_STARTUP_PATH
  2605.         override the search path for the startup and help files.
  2606.  
  2607.  
  2608.     Command line options
  2609.     --------------------
  2610.     The command line options are fairly straightforward.  vile does not
  2611.     support running just _any_ command after a '+', as does vi, but does
  2612.     support the commonly used '+400' to go to line 400 and '+/foo' to
  2613.     search for foo.  Command files can be explicitly executed on
  2614.     startup by prefixing them with the '@' character, as in "vile
  2615.     @mycmds file.c".  This will suppress the operation of VILEINIT and
  2616.     the .vilerc files.
  2617.  
  2618.     Use "vile -?" to get the usage message.
  2619.  
  2620.     +NNN and -gNNN  vile will begin the session on the first file
  2621.         at the specified line number.
  2622.  
  2623.     +/pattern or -s pattern   In the first file, vile will execute an
  2624.         initial search for the given pattern.
  2625.  
  2626.     -t tag  vile will edit the correct file and move the cursor
  2627.         to the location of the tag.  This requires a tagsfile
  2628.         created with the ctags(1) command.
  2629.  
  2630.     -h      Invokes vile on the helpfile.
  2631.  
  2632.     -v    Invokes vile in "view" mode - no changes are permitted
  2633.         to the buffer in this mode.  (This will also be true if
  2634.         vile is invoked as view.)
  2635.  
  2636.     -V    vile will report its version number.
  2637.  
  2638.     @cmdfile   vile will run the specified file as its startup
  2639.         file, and will bypass any normal startup file (i.e.
  2640.         .vilerc) or environment variable (i.e. $VILEINIT).
  2641.  
  2642. Encryption
  2643. ----------
  2644.     vile implements a simple encryption algorithm, and can apply this
  2645.     to your buffers either automatically (via a mode setting) or
  2646.     manually (via an explicit command).  The algorithm is reversible,
  2647.     so crypting a previously crypted buffer or region will undo that
  2648.     encryption.
  2649.  
  2650.     The encryption key for a buffer will be a) inherited from the
  2651.     global cryptkey which was set via the vile command line (-k) if it
  2652.     exists, b) set with the set-crypt-key (^X-X) command, or c)
  2653.     obtained from the user interactively.  The details of this are a
  2654.     little messy, and should probably be cleaned up somewhat.  The
  2655.     buffer's key will remain active until changed or reset.
  2656.  
  2657.     If "crypt" mode is on, then when the buffer is written the user
  2658.     will be prompted for the encryption key to use in none has yet been
  2659.     set.  If "crypt" mode is on, and an encryption key has been set,
  2660.     then the buffer will be crypted when read.  In practice this means
  2661.     you need to read the file, then set crypt mode, then reread the
  2662.     file.  (Or, equivalently, create the buffer, set crypt mode, and
  2663.     then insert the file into it (with ":r").
  2664.  
  2665.     The ^X-C operator will crypt an arbitrary region of a buffer, using
  2666.     the current key.  Note that crypting two adjacent regions
  2667.     separately will _not_ produce the same result as crypting their
  2668.     single equivalent region once.
  2669.  
  2670.     vile's encryption algorithm is also available externally, via the
  2671.     "vile-crypt" program built from the same sources.  vile-crypt will
  2672.     encrypt/decrypt a file using vile's crypt algorithm.  You can use
  2673.     "-k key" to supply the key on the commandline, and "-m" to treat
  2674.     the file as a mail message -- in that case, only text after the
  2675.     first blank line will be crypted.  Text to be encrypted can be
  2676.     specified as filenames on the command line, or provided as the
  2677.     standard input.  All output appears on stdout.  On systems with
  2678.     a getpass() library routine, the user will be prompted for the
  2679.     encryption key if it is not given on the command line.  To
  2680.     accomodate systems (such as linux) where the getpass() library
  2681.     routine is not interruptible from the keyboard, entering a
  2682.     crypt-key password which ends in ^C will cause the program to quit.
  2683.  
  2684.  
  2685. Crash Recovery
  2686. --------------
  2687.  
  2688.     The "vi -r" option, used to recover an edited buffer after a system
  2689.     crash, is not present in vile.  If vile itself crashes (usually
  2690.     (though infrequently :-) due to a bug, but perhaps due to an
  2691.     externally applied signal), it will attempt to save any modified
  2692.     buffers in a directory under /tmp, and send mail to the user to
  2693.     that affect.  If system crashes are frequent on your system, you
  2694.     should stop using it.  You might also consider the "autosave" and
  2695.     "autowrite" options, which will cause more frequent saves of your
  2696.     work.
  2697.  
  2698.  
  2699. Mode line customization
  2700. -----------------------
  2701.  
  2702.     At the bottom of each window is a mode (or "status") line which
  2703.     is used for displaying certain characteristics of the window and
  2704.     the buffer associated with it.  On most displays, this mode line
  2705.     will be highlighted in reverse video or via other means in order
  2706.     to visually separate windows and to distinguish the mode line from
  2707.     text displayed in the window.
  2708.  
  2709.     The editor variable "modeline-format" is set to a string which
  2710.     controls formatting of mode lines.  This variable is user settable and
  2711.     thus may be used to customize the display of mode lines.  The
  2712.     format specifiers which may appear in the format control strings
  2713.     are as follows:
  2714.  
  2715.         %i     insert/overwrite/replace mode indicator, displayed
  2716.             only when in insert, overwrite, or replace mode.
  2717.             When not in one of these modes, the separator
  2718.             character (often "-", "=", or " ") will be displayed.
  2719.         %b    buffer name
  2720.         %f    file name when not internal buffer and when not the
  2721.             same as the buffer name.
  2722.         %F    internal buffer name
  2723.         %m    major mode(s), e.g., cmode, view-only, etc.  Displayed
  2724.             in square brackets.
  2725.         %l    line number to be displayed if "ruler" is set
  2726.         %c    column number if "ruler" is set
  2727.         %p    line number as percentage of number of lines if
  2728.             "ruler" is set
  2729.         %S    rough position of window with respect to buffer (top,
  2730.             bot, all, emp, mid) when ruler not set (or ruler is
  2731.             set, but buffer is empty).
  2732.         %L    number of lines in buffer, if ruler is set
  2733.         %=    middle separator; should appear at most once in a
  2734.             format string.  This indicates where to separate the
  2735.             left and right hand portions of the mode line with a
  2736.             long string of dashes (or whatever the separator
  2737.             character is).
  2738.         %-    single occurrence of separator character
  2739.         %|    eighty column indicator
  2740.         %%    percent sign
  2741.         %:    colon
  2742.  
  2743.     Some of the format specifiers (%f, %F, %m, %l, %c, %p, %S, %L) are
  2744.     conditionally displayed.  For example "%m" will display the major
  2745.     modes only if there are some major modes set or if the buffer has
  2746.     been modified (which is sort of a major mode).  Similarly, "%F" and
  2747.     "%f" will cause the associated file name to be displayed when the
  2748.     buffer is of the appropriate type (a scratch buffer or not) and the
  2749.     shortened file name is different from the buffer name.  It is
  2750.     desirable at times to cause a prefix string and/or a suffix string
  2751.     to be emitted along with the string obtained after conversion of
  2752.     the format specifier.  This may be done by following the format
  2753.     specifier with a colon, the prefix string, another colon, the
  2754.     suffix string, and another colon.  For example, "%l:(:,:%c::) :"
  2755.     might be used to display the line and column number for "ruler"
  2756.     mode.  Note that either or both of the prefix and suffix strings
  2757.     may be empty.
  2758.  
  2759.     Characters in the string which are not part of a format specifier
  2760.     are output verbatim.
  2761.  
  2762.     The default format control string is as follows:
  2763.  
  2764.         "%-%i%- %b %m:: :%f:is : :%=%F: : :%l:(:,:%c::) :%p::% :%S%-%-%|"
  2765.  
  2766.     Mode lines for some versions of vile previous to version 4.7 can be
  2767.     obtained with the following format string.  This will remove the
  2768.     percentage indication from the mode line when in ruler mode and
  2769.     also shift the ruler indicator to the far right in the mode line.
  2770.  
  2771.         "%-%i%- %b %m:: :%f:is : :%=%F: : %-%-%-%-:%l:(:,:%c::):%S::%-%-:%|"
  2772.  
  2773. Filtering "man" pages
  2774. ---------------------
  2775.  
  2776.     When used in conjunction with the vile-manfilt program (supplied as
  2777.     source file "manfilt.c"), either vile or xvile may be used to filter
  2778.     and view manual pages.  xvile will even display (with your font set
  2779.     properly) certain portions of the manual page text in bold or
  2780.     italics as appropriate.
  2781.  
  2782.     The file manpage.rc (found in the vile source directory, and also
  2783.     copied below) contains a macro which is bound to ^X-m.  It will
  2784.     prompt for a manual page, filter it, attach attributes and display
  2785.     it in the current window.  The text of manpage.rc may be either
  2786.     incorporated verbatim into your .vilerc file or may be read from
  2787.     your .vilerc as follows:
  2788.  
  2789.         source ~/manpage.rc
  2790.  
  2791.     This assumes that you have moved the manpage.rc file to your home
  2792.     directory.  If you do all of this but use vile rather than xvile,
  2793.     you will still end up with a legible man page, albeit without the
  2794.     spiffy formatting.
  2795.  
  2796.     The manual page filtering program may also be used to look at other
  2797.     text formatted with nroff.  From the vile source directory, for
  2798.     example, the following command will format and filter the vile
  2799.     manual page (which is nroff source).
  2800.  
  2801.         :e !nroff -man vile.1 | vile-manfilt
  2802.  
  2803.     Once loaded, it will look rather funny.  There will be Cntl-A
  2804.     characters scattered throughout the text followed by a sequence of
  2805.     digits followed by one or more uppercase letters followed by a
  2806.     colon.  These Cntl-A sequences specify how the text following the
  2807.     colon should be attributed.  The vile command
  2808.     "attribute-cntl_a-sequences-til" (bound to ^A-A) may be used to
  2809.     format a region of text containing these sequences.  To continue our
  2810.     example, the following command will translate this representation of
  2811.     attributed text into one which is more pleasing to look at.
  2812.  
  2813.         ^A-AG
  2814.  
  2815.     Here is the macro from the file manpage.rc:
  2816.     ;;
  2817.     ;; Macros for obtaining manual pages and then attributing them.
  2818.     ;;
  2819.     ;; Author: Kevin Buettner
  2820.  
  2821.     29 store-macro
  2822.         set-variable %manpage @"man page? "
  2823.         ~if &or &seq %manpage "ERROR" & seq %manpage ""
  2824.             ~return
  2825.         ~endif
  2826.         set-variable %manpagebuf &cat "<" &cat %manpage ">"
  2827.         set terse
  2828.         ~force select-buffer %manpagebuf
  2829.         ~if ¬ $status
  2830.             edit-file &cat "!man " &cat %manpage " | vile-manfilt"
  2831.             ~force rename-buffer %manpagebuf
  2832.             ~force error-buffer %manpagebuf
  2833.             write-message "[Attaching attributes...]"
  2834.             goto-beginning-of-file
  2835.             setl noview
  2836.             attribute-cntl_a-sequences-til end-of-file
  2837.             unmark-buffer
  2838.             setl view
  2839.             goto-beginning-of-file
  2840.             write-message "[Done formatting manual page.]"
  2841.         ~endif
  2842.         set noterse
  2843.     ~endm
  2844.     bind-key execute-macro-29 ^X-m
  2845.  
  2846. Filtering C programs
  2847. --------------------
  2848.     C program text may be displayed with keywords and comments
  2849.     highlighted in a similar fashion to the man page filtering
  2850.     described above.  A filter which performs this is supplied with
  2851.     vile, and is called "vile-c-filt" (source is "c-filt.c").  Its use
  2852.     is described more fully in comments at the head of the source file.
  2853.     It doesn't provide what one would describe as "tightly integrated
  2854.     syntax coloring".  Its usefulness is limited by reliance on an
  2855.     external filter to do the coloring, and the fact that the filter
  2856.     interferes with the normal undo history of the buffer (since it
  2857.     must modify the buffer to do its work).  Nonetheless, it's an
  2858.     interesting adjunct to the editor.
  2859.  
  2860.     Here is a macro one might use to invoke the colorizer:
  2861.         30 store-macro
  2862.             write-message "[Attaching C/C++ attributes...]"
  2863.             set-variable %savcol $curcol
  2864.             set-variable %savline $curline
  2865.             set-variable %modified $modified
  2866.             goto-beginning-of-file
  2867.             filter-til end-of-file "vile-c-filt"
  2868.             goto-beginning-of-file
  2869.             attribute-cntl_a-sequences-til end-of-file
  2870.             ~if ¬ %modified
  2871.                 unmark-buffer
  2872.             ~endif
  2873.             %savline goto-line
  2874.             %savcol goto-column
  2875.             write-message "[Attaching C/C++ attributes...done ]"
  2876.         ~endm
  2877.         bind-key execute-macro-30 ^X-q
  2878.  
  2879.     The vile-c-filt program does its work based on the contents of
  2880.     $HOME/.vile.keywords, which contains a set of keyword/attribute
  2881.     pairs.  An example (and probably insufficient) .vile.keywords file
  2882.     might contain:
  2883.         Comments:B
  2884.         Literal:B
  2885.         Cpp:U
  2886.         if:C3
  2887.         else:C3
  2888.         for:C3
  2889.         while:C3
  2890.         do:C3
  2891.         typedef:I
  2892.         struct:I
  2893.     The "Comments" keyword is a pseudo-keyword which determines the
  2894.     attribute given to C and C++ style comments.  "Literal" applies to
  2895.     string literals. "Cpp" applies to C preprocessor lines, e.g., #if,
  2896.     etc.
  2897.  
  2898.     An alternative filter, written using "flex", is available in
  2899.     c-filt.flx.  It might suit your needs better, or be a better
  2900.     starting point for creating similar coloring mechanisms for other
  2901.     languages.
  2902.  
  2903. Writing your own filters
  2904. ------------------------
  2905.     Filters may be written as either an external program or with
  2906.     the Perl interface.  Both the manual page filter and the C
  2907.     program colorizer are examples of external programs which do
  2908.     the filtering.  The hgrep.pl perl script is an example of a
  2909.     filter which uses the vile's interface to Perl.
  2910.  
  2911.     Regardless, the goal of the filter is to embed in the text
  2912.     a control sequences which describe how the subsequent text
  2913.     should be attributed by the vile command
  2914.  
  2915.         attribute-cntl_a-sequences-til
  2916.  
  2917.     (See above for examples of how to use this command.)
  2918.  
  2919.     The control sequences take the following form:
  2920.  
  2921.         ^A<Count><Attr>:
  2922.  
  2923.     <Count> is a sequence of digits representing the number of
  2924.     characters following the ':' to be attributed.
  2925.  
  2926.     <Attr> is a sequence of characters which indicates how to
  2927.     attribute the required number of characters following the
  2928.     ':'.  The following sequences are recognized by vile:
  2929.  
  2930.         I        -- italic
  2931.         B        -- bold
  2932.         R        -- reverse (or inverse) video
  2933.         U        -- underline
  2934.         C<hex digit>    -- color number (one of 16)
  2935.         H<command>\0    -- hypertext command
  2936.  
  2937.     The <command> for hypertext commands may be any sequence of
  2938.     characters except for newlines and null characters.  A null
  2939.     character must terminate the hypertext command.  The command
  2940.     should be a valid vile command such as you might enter into
  2941.     your .vilerc file.
  2942.  
  2943.     The attribute characters may be used together in any
  2944.     combination.  So, for example, you could use the following
  2945.     to make some text appear both bold and italic:
  2946.  
  2947.         ^A15IB:Bold and italic
  2948.  
  2949. Hypertext
  2950. ---------
  2951.     Vile does not currently supply a builtin key binding for
  2952.     executing hypertext commands.  The following macro and
  2953.     key binding will cause the space bar to be bound to a macro
  2954.     which will follow a hypertext link when the cursor is placed
  2955.     on top of it.  If no hypertext link is present, then the
  2956.     normal default action of advancing one character to the
  2957.     right is taken:
  2958.  
  2959.         22 store-macro
  2960.         ~force execute-hypertext-command
  2961.         ~if  ¬ $status
  2962.             ~force forward-character-to-eol
  2963.         ~endif
  2964.         ~endm
  2965.         bind-key execute-macro-22 \
  2966.  
  2967.     [ Note to Paul and Tom:  Maybe we should just add a little
  2968.       bit of code to make this the default binding for space bar?
  2969.       Or is some other key binding preferable?  In any event,
  2970.       it'll only take 7 or 8 lines to do the job... ]
  2971.  
  2972.     When using xvile, double clicking on a hypertext link will
  2973.     cause the hypertext command to be executed.  If no hypertext
  2974.     command is associated with the text under the cursor, the
  2975.     default action of selecting the word under the cursor will
  2976.     occur instead.
  2977.  
  2978. X Window System specifics
  2979. -------------------------
  2980.  
  2981.     If you are using xvile under X11, the following additions are
  2982.     available:
  2983.  
  2984.     Mouse Buttons
  2985.     -------------
  2986.  
  2987.     1 -    Sets cursor position and the start of the selection when
  2988.         mouse pointer is positioned in any vile window (but not the
  2989.         message line).    Clicking on a mode line will set the
  2990.         keyboard focus to the corresponding vile window.  Double
  2991.         clicking on a mode line will do the above in addition to
  2992.         clearing the highlighting associated with the current
  2993.         selection.
  2994.  
  2995.         Selections may be made by holding button one down and
  2996.         "wiping" with the mouse.  Release of the mouse button will
  2997.         cause the selection to be yanked and made available (if
  2998.         desired) for pasting.  The region selected may be forced to
  2999.         be rectangular by holding the control key down while wiping
  3000.         with button one depressed.  If the wiping motion goes out of
  3001.         the current window, text will be scrolled in the appropriate
  3002.         direction if possible to accommodate selections larger than
  3003.         the window.  The speed at which the scrolling occurs will
  3004.         increase with the passage of time making it practical to
  3005.         select large regions of text quickly.
  3006.  
  3007.         Individual words or lines may be selected by double or
  3008.         triple clicking.
  3009.  
  3010.     2 -    Paste the current PRIMARY selection.  With a shift modifier,
  3011.         it pastes at the mouse position, otherwise it pastes at
  3012.         the last text cursor position before selecting.
  3013.  
  3014.     3 -    Extend the current selection.  As with button one, the
  3015.         selection may be adjusted or scrolled by holding down button
  3016.         three and wiping with it.  Selections may be extended in any
  3017.         window open to the same buffer as which the selection was
  3018.         started in.
  3019.  
  3020.     [ As described below in the "Scrollbars" section, the buttons
  3021.     are modified by the control key as follows, when used on a scrollbar:
  3022.  
  3023.     Ctrl-Button-1 splits the clicked-on window into two windows.
  3024.     Ctrl-Button-2 deletes the clicked-on window.
  3025.     Ctrl-Button-3 makes the clicked-on window the only window. ]
  3026.  
  3027.  
  3028.     Areas of selected text can be operated on with any vile operator
  3029.     command, in conjunction with the special "motion" command '^S',
  3030.     which applies the operator to the selected region.  For example,
  3031.     after selecting text with the mouse, it can be converted to
  3032.     uppercase with ^A-u^S.    Remember that some operators (e.g. the
  3033.     shell-filtering operator, '!') are only capable of working on full
  3034.     lines of text.
  3035.  
  3036.     Clipboard
  3037.     ---------
  3038.  
  3039.     Data may be exchanged between many X applications via the
  3040.     PRIMARY selection.  This selection is set and manipulated as
  3041.     described in the above section entitled "Mouse Buttons".
  3042.  
  3043.     Other applications, most notably OpenLook applications, use
  3044.     the CLIPBOARD selection to exchange data between applications.
  3045.     On many Sun keyboards, selected text is moved to the clipboard
  3046.     by pressing the "Copy" key and pasted by pressing the "Paste"
  3047.     key.  If you find that you can not paste text selected in
  3048.     xvile in other applications or vice-versa, it may well be that
  3049.     these applications use the CLIPBOARD selection instead of the
  3050.     PRIMARY selection.  (The other mechanism used among really old
  3051.     applications involves the use of a ring of cut buffers.)
  3052.  
  3053.     xvile provides two commands for manipulating with the
  3054.     clipboard.  These are copy-to-clipboard and
  3055.     paste-from-clipboard.  When copy-to-clipboard is executed, the
  3056.     contents of the current selection are copied to the special
  3057.     clipboard kill register (denoted by ';' in the register list).
  3058.     When an application requests the clipboard selection, xvile
  3059.     gives it the contents of this kill register.  The
  3060.     paste-from-clipboard command requests clipboard data from the
  3061.     current owner of the CLIPBOARD selection.
  3062.  
  3063.     Users of Sun systems may want to put the following key
  3064.     bindings in their .vilerc file in order to make use of the
  3065.     Copy and Paste keys found on their keyboards:
  3066.  
  3067.         bind-key copy-to-clipboard #-^
  3068.         bind-key paste-from-clipboard #-*
  3069.  
  3070.     Scrollbars
  3071.     ----------
  3072.  
  3073.     The X toolkit version of xvile provides default translations
  3074.     similar to the translations for scrollbars found in the Athena
  3075.     widget set.  (If you know how to use xterm's scrollbars, you know
  3076.     how to use these scrollbars.)  Button one scrolls forward.  Button
  3077.     three scrolls backward.  The amount of scrolling obtained by these
  3078.     buttons depends on the position at which they were pressed on the
  3079.     scrollbar.  Clicking near the top of the scrollbar will scroll the
  3080.     text by a small amount which may be as little as one line.
  3081.     Clicking in the middle will scroll by about half a page.  Clicking
  3082.     near the bottom will scroll by a larger amount up to a whole page.
  3083.     Holding either one of these buttons down will cause repeated
  3084.     scrolling.
  3085.  
  3086.     If simply pressed and released, button two will set the position in
  3087.     the buffer to a position proportional to the location of the
  3088.     pointer on the scroll bar.  Button two may be held down to "drag"
  3089.     the slider from one place to another causing text to scroll
  3090.     continuously.
  3091.  
  3092.     The Motif and OpenLook versions provide scrollbars from their
  3093.     respective widget sets.  Both versions have a slider indicating the
  3094.     position of the window over the buffer.  OpenLook's slider is fixed
  3095.     in size with little arrows at the top and bottom of the slider.
  3096.     Pressing on one of these arrows will cause scrolling in the
  3097.     appropriate direction.    The slider may be "grabbed" and moved by
  3098.     pressing and dragging the middle portion between the arrows.
  3099.     Motif's slider is solid with size varying to indicate the size of
  3100.     the window with respect to the size of the buffer.  Any portion of
  3101.     it may be grabbed for movement.  There are little arrows at the top
  3102.     and bottom of the scroll bar which may be clicked upon to cause
  3103.     scrolling by one line.    In both of these widget sets, clicking on
  3104.     the scrollbar either above or below the slider will cause scrolling
  3105.     by a full page.  OpenLook has two additional control areas; the
  3106.     buffer position may be set to either the beginning or end of the
  3107.     buffer by pressing on one of the little rectangular areas at either
  3108.     the top or bottom of the scrollbar.
  3109.  
  3110.     In all versions built with scrollbars enabled, you can resize
  3111.     windows by moving the border between corresponding scrollbars (with
  3112.     the mouse).  The X toolkit version is probably the most functional,
  3113.     with the windows being continuously resized as the mouse is moved.
  3114.     The OpenLook and Motif versions wait until after a position is
  3115.     selected to resize the windows.  The OpenLook version is perhaps
  3116.     the least functional; there is no visible indication (other than
  3117.     the position of the mouse pointer) to indicate where the new border
  3118.     will be.
  3119.  
  3120.     Splitting and deleting of windows may also be done with the mouse.
  3121.     In each case the action is selected by pressing one of the mouse
  3122.     buttons over a scrollbar with the control key held down.  Button
  3123.     one (with the control key held down) will split the scrollbar and
  3124.     the corresponding vile window with the new border at or near the
  3125.     mouse cursor.  Button two (with control key) will delete the
  3126.     scrollbar and corresponding window.  Button three (with control
  3127.     key) will make the corresponding window the only window.
  3128.  
  3129.     Standard X command line arguments
  3130.     ---------------------------------
  3131.  
  3132.     -fn fontname    Font to use (or -font).
  3133.     -rv        Use reverse video (also -reverse).
  3134.     +rv        Don't use reverse video.
  3135.     -display disp    Display to run xvile on.
  3136.     -fg color    Foreground color (or -foreground).
  3137.     -bg color    Background color (or -background).
  3138.     -bd color    Border color (or -bordercolor).
  3139.     -name name    Name used for resource lookups.
  3140.     -title name    Name to be displayed in titlebar.
  3141.     -geometry geom    Initial window dimensions in columns and rows.
  3142.     -iconic     Start xvile iconified.
  3143.     -xrm Resource    Specify or change an X resource internal to xvile.
  3144.  
  3145.     Additional xvile command line arguments
  3146.     ---------------------------------------
  3147.  
  3148.     -fork        to spawn xvile immediately on startup
  3149.     +fork        to force xvile to not spawn on startup
  3150.     -leftbar    Put scrollbar(s) on left.
  3151.     -rightbar    Put scrollbar(s) on right (default).
  3152.  
  3153.     Setting a new process group
  3154.     ---------------------------
  3155.     Some systems and/or some shells and display managers seem to want
  3156.     xvile to run in its own process group, to help isolate its signals
  3157.     and actions from the signals and actions of the parent process
  3158.     (i.e. the shell or window manager that starts xvile).  xvile can
  3159.     be forced into its own process group with the "new-process-group"
  3160.     command, which one would put in the .vilerc file.  Using this will
  3161.     cause a call to "setpgrp()" or "setsid()".  This behavior is not
  3162.     the default because a) it can't be undone, and b) it seems
  3163.     undesirable on some systems, in that xvile cannot be suspended and
  3164.     put in the background after startup if it's in its own group.
  3165.  
  3166.     Additionally, if given a count as argument, this command will cause
  3167.     xvile to fork(), and the parent to exit before the new process
  3168.     group is set by the child.  This will further isolate it from its
  3169.     process environment (and in fact will move xvile into the background
  3170.     if started from the shell).
  3171.  
  3172.     The "new-process-group" command has no effect in non-X11 versions
  3173.     of vile.
  3174.  
  3175.  
  3176.     X Resources
  3177.     -----------
  3178.  
  3179.     font        Font to use.
  3180.  
  3181.     geometry    Window dimensions in characters.
  3182.  
  3183.     charClass    Character classes for multiple click selections.
  3184.             The format is identical to that of xterm(1).
  3185.  
  3186.     multiClickTime    How long between clicks (in milliseconds) to
  3187.             be accepted as a multi-click.
  3188.  
  3189.     foreground
  3190.     background    Foreground/Background color of the main xvile text
  3191.             area.
  3192.  
  3193.     cursor.foreground
  3194.     cursor.background   Foreground/Background color of the cursor.
  3195.             By default the cursor location is indicated by
  3196.             inverting the foreground and background colors of
  3197.             the cell the cursor is over.  Thus the color of the
  3198.             cursor will vary depending upon location.  Use of
  3199.             these subresources will cause the cursor to
  3200.             maintain constant coloration of the user's
  3201.             choosing, and may make it easier to see when it
  3202.             appears in a "highlighted" or "selected" area of
  3203.             text.
  3204.  
  3205.     menuBackground
  3206.     menuForeground    Optional (OPT_MENUS_COLORED, works with Motif) resources
  3207.             for setting the background and foreground colors of
  3208.             menubar and pulldown menus.
  3209.  
  3210.     modeline.focusForeground
  3211.     modeline.focusBackground   Foreground/Background color of the mode
  3212.             line corresponding to the window with focus, i.e.
  3213.             the "current" window.
  3214.  
  3215.     modeline.foreground
  3216.     modeline.background   Foreground/Background color of mode lines
  3217.             corresponding to windows without the keyboard
  3218.             focus.  modeline.background is also used for the
  3219.             scrollbar borders and resize grips.
  3220.  
  3221.     forkOnStartup    If true, xvile forks after initialization.
  3222.  
  3223.     focusFollowsMouse  If true, the "current" window is the window
  3224.             inhabited by the mouse; no clicking is necessary
  3225.             to change windows.
  3226.  
  3227.     pointer.foreground
  3228.     pointer.background   Foreground/Background color of the pointer.
  3229.  
  3230.     pointer.normalShape
  3231.     pointer.watchShape   Set the shapes for the normal and watch pointers
  3232.             respectively.
  3233.  
  3234.     scrollbarOnLeft Either true or false; control the placement of
  3235.             the scrollbars.  By default, scrollbars are placed
  3236.             on the right.
  3237.  
  3238.     scrollbarWidth    An integer indicating the width of the scrollbar.
  3239.  
  3240.     scrollbar.foreground
  3241.     scrollbar.background  Foreground/Background color of the slider or
  3242.             one of the colors of the slider if a stippled
  3243.             pixmap is used.  To force the slider to be only the
  3244.             foreground color, you should set sliderIsSolid to
  3245.             true.  (X toolkit version only)
  3246.  
  3247.     scrollbar.sliderIsSolid  If false, indicates that the stippled
  3248.             pixmap should be used to simulate grey.  This will
  3249.             be best on monochrome displays.  True works better
  3250.             for color displays.  True indicates the slider will
  3251.             be displayed in the foreground color, shaded to
  3252.             look three-dimensional, if possible.  (X toolkit
  3253.             version only)
  3254.  
  3255.     scrollRepeatTimeout  Amount of time in milliseconds to wait initially
  3256.             before repeating scroll when button one or three are
  3257.             held down. (X toolkit version only).
  3258.  
  3259.     scrollRepeatInterval  Amount of time to wait between repeating
  3260.             subsequent scrolls.   This parameter is also used
  3261.             for controlling the speed at which selections are
  3262.             scrolled.
  3263.  
  3264.     selection.foreground
  3265.     selection.background  Foreground/Background color of the selection
  3266.             regions.  "foreground" is the color that
  3267.             the text is displayed in.
  3268.  
  3269.     persistentSelections  If true (the default), highlighting of the
  3270.             selection will persist even when button one is
  3271.             pressed to set the cursor position.  A false value
  3272.             will behave more like other X applications in which
  3273.             display of the selection is lost as soon as button
  3274.             one is pressed.
  3275.  
  3276.     selectionSetsDOT  If false (the default), the cursor will be restored
  3277.             to its previous position prior to making the selection.
  3278.             If true, the cursor will be positioned at the location
  3279.             of the mouse at the end of making a selection (usually
  3280.             at either the start or end of a selection).
  3281.  
  3282.     blinkInterval    An integer indicating the time in milliseconds to wait
  3283.             before blinking the cursor.  A positive value will
  3284.             cause the cursor to always blink.  Setting
  3285.             blinkInterval to zero will cause the cursor to never
  3286.             blink which may be useful on some display servers
  3287.             connected to very slow networks.  The disadvantage
  3288.             of setting it to zero is that it is sometimes hard
  3289.             to tell where the cursor is when situated at the
  3290.             boundary of a highlighted region.  A negative value
  3291.             (which is the default) will cause the cursor to
  3292.             blink only when situated in a highlighted region
  3293.             such as a selection.  This will make the cursor
  3294.             visible no matter where it is.
  3295.  
  3296.     color.fcolor1,
  3297.     color.bcolor1, ...,
  3298.     color.fcolor15,
  3299.     color.bcolor15
  3300.             When doing text attribution with the
  3301.             "attribute-cntl_a-sequences-til" command (bound to
  3302.             ^A-A), the attribute may be of the form "Cn", where
  3303.             'n' is a hex digit.  This digit picks one of the 16
  3304.             fcolor/bcolor pairs set up in the color
  3305.             subresource.  For example, if the buffer contained
  3306.             the text:
  3307.                 ^A6C3:foobar
  3308.             then after the ^A-A command was applied, the leading
  3309.             "^A3C3:" would be gone, and the word "foobar" would
  3310.             appear in the foreground and background colors
  3311.             specified by color.fcolor3 and color.bcolor3.  Either
  3312.             of the pair can be left unspecified, and will default
  3313.             to the natural foreground or background color of
  3314.             normal text.
  3315.  
  3316.     menuHeader
  3317.     menuEntry    The names given to the menu header and entries,
  3318.             respectively.
  3319.     menuHeight    resource controlling the Athena menu-height
  3320.  
  3321.     Sample .Xdefault entries
  3322.     ------------------------
  3323.  
  3324.     You may or may not want to use the following as a starting point
  3325.     for the "XVile" section of your .Xdefaults or .Xresources file.  If
  3326.     you have a monochrome display server, you will probably not want
  3327.     to use any of the color specifications.  You may, however, wish
  3328.     to set up a blinking cursor, using "blinkInterval"  (see above).
  3329.  
  3330.     XVile*font: -*-courier-medium-r-normal-*-*-*-75-75-m-70-iso8859-*
  3331.     XVile*geometry:    80x54
  3332.     XVile.background: darkslategrey
  3333.     XVile.foreground: honeydew
  3334.     XVile.scrollbar.foreground: firebrick2
  3335.     XVile.scrollbar.sliderIsSolid: true
  3336.     XVile.selection.background: aquamarine4
  3337.     XVile.selection.foreground: honeydew
  3338.     XVile.cursor.background: yellow
  3339.     XVile.cursor.foreground: darkslategrey
  3340.     XVile.modeline.Background: steelblue
  3341.     XVile.modeline.foreground: darkslategrey
  3342.     XVile.modeline.focusForeground: yellow
  3343.  
  3344.     Fonts
  3345.     -----
  3346.  
  3347.     To change the font on the fly, use the ':setv' command to set the
  3348.     $font variable, with ":setv $font <fontname>".
  3349.  
  3350.     At present, only xvile is capable of displaying bold and italic (or
  3351.     underline) text associated with attributes.  It is anticipated that
  3352.     other versions of vile will catch up to the best of their ability.
  3353.     Users of xvile will find that the italic font in particular is not
  3354.     always available with the font that they've chosen (or have had
  3355.     chosen for them).  If an italic font is unavailable, xvile will
  3356.     underline text which is meant to be italic.  The program xfontsel is
  3357.     quite useful for determining which fonts are available on your
  3358.     display server and whether there are corresponding bold and/or
  3359.     italic fonts available.
  3360.  
  3361.     Here are some tips on using xfontsel to find an appropriate font.
  3362.  
  3363.         1) Set rgstry (registry) to iso8859
  3364.         2) Set spc (spacing) to either "c" (cell font) or "m"
  3365.            (monospaced font).  You will be more likely to find a
  3366.            font which will work as italic if you choose a
  3367.            monospaced font, however.  You definitely do not want
  3368.            a proportional font.
  3369.         3) Now pull down the slant menu.  Select either "i"
  3370.            (italic) or "o" (oblique).  If neither of these are
  3371.            available, go back to step 2 and choose a different
  3372.            spacing.
  3373.         4) Set avgWdth (average width) next. If you divide the
  3374.            value you've chosen by ten, this will be width of a
  3375.            glyph in the font in pixels.
  3376.         5) Set wght (weight) to medium.  If you have a hard time
  3377.            seeing the characters, you might want to choose bold,
  3378.            but xvile will not be able to use the bold font for
  3379.            displaying bold text.  It will be forced to overwrite
  3380.            text that it wants to be bold with the text shifted by
  3381.            one pixel.  This works fairly well for larger fonts.
  3382.         6) Set fmly (family) to a value according to personal taste.
  3383.            By this step, you might not have any choice on the matter
  3384.            anyway.
  3385.         7) If only one font is available at this point, the other
  3386.            fields don't matter that much.  Otherwise set these
  3387.            according to taste.
  3388.         8) Go back to the slant menu and change either the "i" or
  3389.            "o" to "r".
  3390.  
  3391.         This will be the font to use.  xvile will be attempt to get
  3392.         the italic font when needed by substituting either "o" or
  3393.         "i" for the "r".
  3394.  
  3395.     If the above seems too tedious, you can just try the following font
  3396.     which (on many display servers) is pretty close to the size of the
  3397.     default font that xvile will start up with.
  3398.  
  3399.         -*-courier-medium-r-*-*-*-*-*-*-*-70-*-*
  3400.  
  3401.     You can try it out by issuing the appropriate "set font" command
  3402.     from xvile.  For longer term use, you will probably want to put it
  3403.     in your .Xdefaults file.  It will look something like this:
  3404.  
  3405.         XVile*font: -*-courier-medium-r-*-*-*-*-*-*-*-70-*-*
  3406.  
  3407.     You may also set the font from your .vilerc file.  This is not
  3408.     recommended, however, as you lose the ability to choose a different
  3409.     font from the command line or resource file.  It may also cause the
  3410.     xvile window to be unnecessarily resized during initialization.
  3411.  
  3412.  
  3413.  
  3414.  
  3415. DOS specifics
  3416. -------------
  3417.  
  3418.     The .vilerc file is called vile.rc under DOS.
  3419.  
  3420.     vile is perfectly happy (and even tries very hard) to use the
  3421.     UNIX-style "forward-slash" ('/') as a path delimiter.  Entering the
  3422.     "backslash" ('\') will work, but you should be aware that vile uses
  3423.     this character as an escape mechanism for entering special
  3424.     characters (e.g. "\t" for TAB) in strings.  As an example setting
  3425.     "tags" to "tags ..\tags" will not have the intended result.
  3426.     Instead, use "tags ..\\tags" or better, "tags ../tags".
  3427.  
  3428.     vile should leave your screen in the mode you're in when you
  3429.     enter it, unless you explicitly change it to a different mode with
  3430.     a "set sres=" line in your vile.rc, or if you use a command line
  3431.     option to change it.  Command line options consist of a dash
  3432.     followed by one of the following selectors (these are the same
  3433.     values that can be assigned to "sres"):
  3434.         "default",
  3435.         "2",     "25",    "80x25",
  3436.         "4",     "43",    "80x43",
  3437.         "5",     "50",    "80x50",
  3438.         "80x14", "80x28",
  3439.         "40x12", "40x21", "40x25", "40x28", "40x50",
  3440.  
  3441.     [ Currently, under DOS, not all modes may work, as a result of
  3442.       the screen library being used... (in version 5.5).  More may
  3443.       work under OS/2. ]
  3444.  
  3445.     If you shell out in 50 line mode, make sure you are in 50 line mode
  3446.     before you exit the dos shell, otherwise you end up with a 50 line
  3447.     edit window with only the top 25 displayed.
  3448.  
  3449.     The vile.rc file can be located in the same directory as your
  3450.     binary executable, since vile searches the PATH for this file.
  3451.  
  3452.     All file globbing, including from the command line, is done using
  3453.     UNIX shell-style wild-carding conventions.
  3454.  
  3455.     The expansion of the ':' character in user input, which normally
  3456.     expands to the "word under the cursor", is suppressed for DOS, due
  3457.     to the conflict with the drive-specifier syntax (e.g. "c:\foo").
  3458.     The character '&' may be used for this instead.
  3459.  
  3460.     In any version of vile there is a command, "set-dos-mode", which
  3461.     will a) strip all carriage-return ('^M') characters from the ends
  3462.     of lines in the buffer and b) set the "dos" mode so that carriage
  3463.     returns are appended when the file is written.  There is also a
  3464.     corresponding "set-unix-mode" command, which strips carriage
  3465.     returns, and forces "nodos" mode, so that they don't come back when
  3466.     you write the file.  In both cases, "dos" mode becomes a so-called
  3467.     "local" mode, so that the rest of your buffers will be unaffected.
  3468.  
  3469.     Vile supports a 16-color palette under DOS, which includes:
  3470.  
  3471.         black, red, green, brown, blue, magenta, cyan,
  3472.         lightgray, gray, brightred, brightgreen, yellow,
  3473.         brightblue, brightmagenta, brightcyan, white
  3474.  
  3475.     If you wish to change vile's internal notion of these colors, put
  3476.     a line in your vile.rc which resets the "palette" variable.  By
  3477.     default its value is "0 4 2 6 1 5 3 7 8 12 10 14 9 13 11 15",
  3478.     which associates each of the above colors with the appropriate
  3479.     PC color attribute.  Under MS-DOS, the palette values are masked
  3480.     with 7 before being used as background colors, to prevent blinking
  3481.     characters.
  3482.  
  3483.  
  3484.  
  3485.  
  3486. Win32 specifics
  3487. ---------------
  3488.  
  3489.     Flavors
  3490.     -------
  3491.     The editor may be invoked/built as a console or GUI application.
  3492.     The former is known as vile.exe and the latter as winvile.exe .
  3493.     For the remainder of this section of the help file, a generic
  3494.     reference to "vile" refers to both the console and GUI editor,
  3495.     unless otherwise stated.
  3496.  
  3497.     Heritage
  3498.     --------
  3499.     The Win32 version of vile supports almost all of the features and
  3500.     changes listed directly above in the section entitled "DOS
  3501.     specifics", with the exception that the editor's screen resolution
  3502.     cannot be changed using explicit -43, -50, etc. command-line
  3503.     switches or via the sres command.
  3504.  
  3505.     Winvile Command-Line Switches
  3506.     -----------------------------
  3507.     Winvile accepts these command-line options in addition to the
  3508.     standard ones:
  3509.  
  3510.     -geometry <C>x<R>      Initial window dimensions in Columns and Rows
  3511.                  (ex:  -geometry 80x30).
  3512.     -fn       <fontspec>   Initial font (or -font).  The "Winvile Font"
  3513.                  section below describes <fontspec> syntax.
  3514.  
  3515.     Pipes
  3516.     -----
  3517.     Internally, vile uses two radically different mechanisms for piping
  3518.     data to and from the shell.  One mechanism uses temporary files and
  3519.     the other simply calls native Win32 services (no temp files).  This
  3520.     dichotomy exists because the NT shell (cmd.exe) handles native
  3521.     pipes relatively cleanly, but the Win95/98 shell (command.com) does
  3522.     not.  If using Win95/98, refer to the file doc/w32modes.doc for the
  3523.     gory details.  By default, then, on a WinNT host, vile's pipes are
  3524.     implemented with Win32 services and via temp files on a Win95/98
  3525.     host.  If the user's replacement shell does not exhibit problems
  3526.     similar to those described above (e.g., Thompson Toolkit Shell),
  3527.     vile may be forced to use native Win32 pipes by setting the global
  3528.     mode "w32pipes" (e.g., "se w32pipes").
  3529.  
  3530.     Mouse
  3531.     -----
  3532.     Selecting and dragging with the left mouse button yanks text to the
  3533.     unnamed register.  Press a control key during the selection to
  3534.     sweep out a rectangular region.  Extend the selection beyond the
  3535.     bottom of the current window by continuing to hold the left mouse
  3536.     button down while moving the cursor back and forth across the
  3537.     window's mode line.
  3538.  
  3539.     Change vile's window focus via left mouse button clicks (when
  3540.     multiple windows are displayed).
  3541.  
  3542.     Clipboard
  3543.     ---------
  3544.     Copy data from the unnamed register to the windows clipboard via
  3545.     the copy-unnamed-reg-to-clipboard command (bound to Alt+Insert).
  3546.     Copy data from a named register or region to the clipboard (a la
  3547.     vile's ^W operator) via the copy-to-clipboard command (bound to
  3548.     Ctrl+Insert).  The paste-from-clipboard command copies data from
  3549.     the clipboard to the current buffer (bound to Shift+Insert).  Some
  3550.     examples, assuming <CI> => Ctrl+Insert and <AI> => Alt+Insert:
  3551.  
  3552.         4yy<AI>  ;copy 4 lines from unnamed reg to clipboard
  3553.         "a<CI>   ;copy register 'a' to clipboard
  3554.         <CI>3w   ;copy 3 words to clipboard
  3555.  
  3556.     OLE Automation
  3557.     --------------
  3558.     Winvile may be invoked as an OLE automation server and thereafter
  3559.     controlled by an OLE client.  Refer to the file doc/oleauto.doc for
  3560.     further details.  Additionally, the OLE client "visvile.dll"
  3561.     provides a mechanism for substituting winvile as the default
  3562.     Developer Studio editor.  Refer to the file doc/visvile.doc for
  3563.     detailed information.
  3564.  
  3565.     Winvile Font
  3566.     ------------
  3567.     Winvile's font may be set via a command-line switch or from within
  3568.     the editor by modifying the $font environment variable.  In either
  3569.     case, a <fontspec> string describes the desired font, where:
  3570.  
  3571.     <fontspec>  :== [<face>,]<size>[,<style>]
  3572.     <face>      :== font-name
  3573.     <size>      :== point size (as an integer)
  3574.     <style>     :== { bold | italic | bold-italic }
  3575.  
  3576.     Note 1:  if <style> is unspecified, "normal" is assumed.
  3577.     Note 2:  if <face> contains a comma, escape it with '\'.
  3578.     Note 3:  if <face> is omitted, the current font is modified.
  3579.     Note 4:  if <face> contains spaces and the font is set from the
  3580.          command-line, delimit <fontspec> as appropriate for the
  3581.          current shell/desktop environment.
  3582.     Note 5:  <face> must be fixed pitch.  To obtain a list of all fixed
  3583.          pitch fonts on the current win32 host, invoke winvile and
  3584.          browse the "Font" dialog box accessible from the System menu
  3585.          (accelerator key is ALT+<space bar>+f).
  3586.  
  3587.     Cmdline Examples        Internal Examples
  3588.     ****************                *****************
  3589.     -fn 'Letter Gothic,8'       :setv $font r_ansi,7
  3590.     -font r_ansi,8,bold         :setv $font 8
  3591.  
  3592.             Vile.rc Example
  3593.             ***************
  3594.             ~if &sequal $progname "winvile"
  3595.                 set-variable $font "courier new,8"
  3596.             ~endif
  3597.  
  3598.     Utilities
  3599.     ---------
  3600.     vile-c-filt has been ported and may be used to statically color
  3601.     source files (refer to the section of this file entitled "Filtering
  3602.     C programs" for further info).  There exist detailed, win32-related
  3603.     comments within the source file c-filt.c that describe minor
  3604.     porting changes, as well as providing example usage that leverages
  3605.     the editor's 16-color palette.
  3606.  
  3607.     Perl
  3608.     ----
  3609.     At the user's discretion, vile may be built with an embedded perl
  3610.     interpreter.  To date, only the perl [binary] distribution at the
  3611.     following URL is supported:
  3612.  
  3613.         http://www.perl.com/CPAN-local/ports/win32/Standard/x86/
  3614.  
  3615.     If you acquire (i.e., do not personally build) a copy of
  3616.     "perl-embedded" vile, these external configuration steps are
  3617.     necessary:
  3618.  
  3619.     1) Obtain the [binary] perl distribution from the aforementioned
  3620.        URL and install it.  Included in this distribution, among many
  3621.        other items, is a required DLL and the usual perl packages.
  3622.  
  3623.     2) [Optional] To invoke vile-based perl scripts distributed with the
  3624.        editor, create an exported environment variable called
  3625.        VILE_LIBRARY_PATH that specifies a directory of your choice.  Then
  3626.        create a subdirectory called %VILE_LIBRARY_PATH%\perl and copy the
  3627.        scripts to same.  The list of scripts known to work in a Win32
  3628.        environment includes:
  3629.  
  3630.         hgrep.pl glob2re.pl visit.pl search.pl hilite.pl syntax.pl
  3631.  
  3632.     Modes
  3633.     -----
  3634.     force-console   Boolean indicating whether or not winvile forces
  3635.             console creation prior to initiating a native read
  3636.             pipe or filter region operation.  Must be set when
  3637.             the host shell doesn't properly communicate with
  3638.             consoles created as a side effect of the
  3639.             CreateProcess() API.  Reset by default on a Win95/98
  3640.             host, since command.com exhibits this problem.
  3641.             Note:  this mode is applicable only when w32pipes
  3642.             is set.  (U)
  3643.  
  3644.     scroll-pause    An integer indicating the time in milliseconds to
  3645.             wait after scrolling the display.  A value of zero,
  3646.             the default, disables this mode.  This mode is
  3647.             necessary when rapid scrolling operations cause
  3648.             improper screen refresh by the console editor
  3649.             (should only be a problem with inexpensive video
  3650.             HW).  Typical values, if required, are 20-80
  3651.             (msec).  (U)
  3652.  
  3653.     w32pipes    See discussion of pipes above.  (U)
  3654.  
  3655.     Windows 95/98 Considerations
  3656.     ----------------------------
  3657.     Refer to the file doc\w32modes.doc for a discussion of the optimum
  3658.     settings of force-console and w32pipes.
  3659.  
  3660.  
  3661.  
  3662.  
  3663. Differences from vi
  3664. -------------------
  3665.  
  3666.     Of course, this really isn't vi.  Some of the following differences
  3667.     deserve changing, others do not.
  3668.  
  3669.     The parser for the ':' commands is not very vi-like.  For instance,
  3670.     ":e" will prompt you for a file name.  Most commands remember their
  3671.     last argument, and will present it as the default reply to their
  3672.     prompt.
  3673.  
  3674.     The backspace, line kill, word kill, job control, etc. characters
  3675.     are not rebindable.  They are, however, read from the tty settings
  3676.     on startup.
  3677.  
  3678.     There is no expansion of ! in filenames.  It is expanded in shell
  3679.     escapes, so the command ":!!" does rerun the previous shell command.
  3680.     Occurrences of '#' and '%' are recognized and expanded to the
  3681.     previous or current filename.
  3682.  
  3683.     Paragraph and section boundaries, for the {, }, [, and ] commands
  3684.     are configurable, but may not exactly match those in vi.  They are
  3685.     expressed via regular expressions.  The default regular expressions
  3686.     are quite complex, to support the traditional nroff and troff
  3687.     boundaries.  If you are just editing code, you may want to replace
  3688.     them:
  3689.  
  3690.         ; set paragraph and section r.e.s for speed on C/C++/perl code.
  3691.         set paragraphs=^$
  3692.         set sections=^[{^L]
  3693.  
  3694.     There is no special lisp support.  But then, when was the last time
  3695.     you heard of a lisp programmer that used vi?
  3696.  
  3697.     Of course, ex and open mode aren't there.  (Too bad.  I'd love
  3698.     to have a companion editor called "exile".)
  3699.  
  3700.     Most, but not all, of the word-motion-with-operator and end-of-line
  3701.     anomalies have been recreated.  One missing anomaly: In vile, "dw"
  3702.     on the last word of a line ending in whitespace deletes the
  3703.     trailing whitespace.  vi does not delete the whitespace.
  3704.  
  3705.     In the real vi, the '_' command is a little-used motion command,
  3706.     which moves the cursor to the start of the Nth next line, where N
  3707.     is the argument given, less 1.  So '2_' takes you to the start of
  3708.     the next line.  Primarily intended for use in an operator context,
  3709.     as in "2d_", it is always exactly equivalent in those cases to
  3710.     "stuttering" the operator, as in "2dd".  Most people know about and
  3711.     use the stuttered form, so in vile, the '_' command is used by
  3712.     default for buffer history.  If the regular vi behavior is desired,
  3713.     put the following in the .vilerc file:
  3714.  
  3715.         bind-key whole-lines _
  3716.  
  3717. Sample .vilerc
  3718. --------------
  3719.  
  3720.     Here's a sample .vilerc, to help get you started with the
  3721.     syntax and style of vile macros:
  3722.  
  3723.     set autoindent
  3724.     set fillcol 75
  3725.     set cmode
  3726.     set c-tabstop 4
  3727.  
  3728.     ; sitting on a brace, run the C code block through indent
  3729.     1 store-macro
  3730.         write-file
  3731.         filter-til goto-matching-fence "indent -st"
  3732.     ~endm
  3733.  
  3734.  
  3735.     ; format the current paragraph
  3736.     2 store-macro
  3737.         previous-paragraph
  3738.         filter-til next-paragraph "/usr/ucb/fmt"
  3739.     ~endm
  3740.  
  3741.     ; put 'fprintf(stderr,"\n");" into the file, and
  3742.     ; position the cursor to add to the string
  3743.     3 store-macro
  3744.         ~force next-line
  3745.         beginning-of-line
  3746.         insert-string "fprintf(stderr, \"\\n\");\n"
  3747.         ; six back, because it counts the newline
  3748.         6 backward-character
  3749.         insert-chars
  3750.     ~endm
  3751.  
  3752.     ; insert '> ' in front of every line from here til the end
  3753.     ; (this works because without argument, the default action
  3754.     ; for "goto-line" is to go to the end of file.
  3755.     4 store-macro
  3756.         substitute-til goto-line "^" "> "
  3757.     ~endm
  3758.  
  3759.     ; spelling keystroke: write the buffer, invoke ispell, and force
  3760.     ;     it to be read back in.
  3761.     2 store-macro
  3762.         write-file
  3763.         ; suppress "press return" with "1" argument to shell-command
  3764.         1 shell-command &cat "ispell " $cfilname
  3765.         replace-with-file $cfilname
  3766.     ~endm
  3767.     bind-key execute-macro-2 =
  3768.  
  3769.  
  3770.  
  3771.     ; the next three give more mnemonic window commands
  3772.     bind-key next-window ^N
  3773.     bind-key previous-window ^P
  3774.     bind-key split-current-window ^T
  3775.  
  3776.     bind-key execute-macro-1 ^A-C
  3777.     bind-key execute-macro-2 ^A-F
  3778.     bind-key execute-macro-3 ^A-K
  3779.     bind-key execute-macro-4 ^A-M
  3780.  
  3781. Notes on TERM types and Scrolling
  3782. ---------------------------------
  3783.  
  3784.     vile will determine the window size in one of three ways: first it
  3785.     will ask the tty driver (using a TIOCGWINSZ ioctl call under UNIX).
  3786.     Failing that, it will use the LINES and COLUMNS environment
  3787.     variables.  As a last resort it will use the size specified in the
  3788.     TERMCAP entry corresponding to the TERM variable.  In addition,
  3789.     vile will attempt to support the SIGWINCH signal, which allows it
  3790.     to track changes to the size of the window in which it is running.
  3791.  
  3792.     If scrolling is really slow, or really ugly (the status line hops
  3793.     around a lot), and you're using a vt102 or compatible terminal that
  3794.     you think should be able to scroll okay, then the problem is almost
  3795.     certainly your termcap entry, which probably doesn't describe
  3796.     scrolling regions adequately.  Most standard termcap entries are
  3797.     insufficient.  The standard "xterm" entry on many systems falls
  3798.     into this category, and vile contains code that, as a special case,
  3799.     will augment an "xterm" entry with the codes needed for scrolling
  3800.     regions.
  3801.  
  3802.     In any case, here's a termcap entry that should work:
  3803.  
  3804.         dy|vt102|vt-102|dec vt102:\
  3805.             :do=^J:co#80:li#24:cl=50\E[;H\E[2J:\
  3806.             :le=^H:bs:cm=5\E[%i%d;%dH:nd=2\E[C:up=2\E[A:\
  3807.             :ce=3\E[K:cd=50\E[J:so=2\E[7m:se=2\E[m:us=2\E[4m:ue=2\E[m:\
  3808.             :md=2\E[1m:mr=2\E[7m:mb=2\E[5m:me=2\E[m:is=\E[1;24r\E[24;1H:\
  3809.             :rs=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:ks=\E[?1h\E=:ke=\E[?1l\E>:\
  3810.             :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\
  3811.             :ho=\E[H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:pt:sr=5\EM:vt#3:\
  3812.             :sc=\E7:rc=\E8:cs=\E[%i%d;%dr:vs=\E[?7l:ve=\E[?7h:
  3813.  
  3814.     The crucial entries are cs and sr -- without both of them,
  3815.     vile will attempt to use dl and al, and will scroll by
  3816.     deleting and inserting a block of lines, giving the ugly
  3817.     behavior you're probably seeing.  If you define PRETTIER_SCROLL
  3818.     when building vile, it will alternately delete and insert lines,
  3819.     instead of deleting them all and then inserting them all.  This
  3820.     makes it look a _little_ better, but it's slower.
  3821.  
  3822.     ( Here is the terminfo entry equivalent to the above termcap entry:
  3823.  
  3824.     vt102|vt-102|dec vt102,
  3825.         xon,
  3826.         cols#80, lines#24, vt#3,
  3827.         bel=^G, blink=\E[5m$<2>, bold=\E[1m$<2>,
  3828.         clear=\E[;H\E[2J$<50>, cnorm=\E[?7h, cr=\r,
  3829.         csr=\E[%i%p1%d;%p2%dr, cub1=\b, cud1=\n,
  3830.         cuf1=\E[C$<2>, cup=\E[%i%p1%d;%p2%dH$<5>,
  3831.         cuu1=\E[A$<2>, cvvis=\E[?7l, ed=\E[J$<50>,
  3832.         el=\E[K$<3>, home=\E[H, ht=\t, ind=\n,
  3833.         is2=\E[1;24r\E[24;1H, kbs=\b, kcub1=\EOD, kcud1=\EOB,
  3834.         kcuf1=\EOC, kcuu1=\EOA, kf1=\EOP, kf2=\EOQ, kf3=\EOR,
  3835.         kf4=\EOS, rc=\E8, rev=\E[7m$<2>, ri=\EM$<5>,
  3836.         rmkx=\E[?1l\E>, rmso=\E[m$<2>, rmul=\E[m$<2>,
  3837.         rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7,
  3838.         sgr0=\E[m$<2>, smkx=\E[?1h\E=, smso=\E[7m$<2>,
  3839.         smul=\E[4m$<2>,
  3840.     )
  3841.  
  3842. Credits
  3843. -------
  3844.  
  3845.     Since version 6.1, Tom Dickey has been maintaining the "official"
  3846.     source tree, and release responsibilities.  Paul Fox maintains the
  3847.     mailing lists.
  3848.  
  3849.     This code has been written by a _lot_ of people, with help from a
  3850.     lot more sending in bug reports, fixes, and suggestions.  The
  3851.     authors of vile are Tom Dickey (dickey@clark.net) and Kevin Buettner
  3852.     (kev@primenet.com), and Paul Fox (pgf@foxharp.boston.ma.us).
  3853.  
  3854.     Names appearing within comments in the micro-Emacs source code are:
  3855.     Dave Conroy, Daniel Lawrence, John Gamble, Roger Ove, Dana Hoggatt,
  3856.     Jon Reid, Steve Wilhite, George Jones, Adam Fritz, D.R.Banks, Bob
  3857.     McNamara, and Brian Straight.
  3858.  
  3859.     Tom Dickey has contributed many code improvements and features, and
  3860.     has stabilized vile on both VMS and DOS.  Kevin Buettner has
  3861.     contributed lots of changes for X11 Toolkit support, as well as the
  3862.     bulk of the selection and video attribute mechanisms, and the bulk of
  3863.     the :map command.  Rick Sladkey has done great stuff making vile
  3864.     work correctly in Win32 environments, something I might not have done
  3865.     for a long time.  Some of the "ex" code is by Steve Kirkendall,
  3866.     author of the vi work-alike "elvis".  The regular expression code and
  3867.     documentation is by Henry Spencer.  The sample .vilerc was created by
  3868.     Dave Lemke; he also contributed code for new features, including the
  3869.     original native X support.  Eric Krohn has done some excellent testing
  3870.     and enhancement.  The implementation of rectangles and their operations
  3871.     was inspired by code from the 'notgnu' editor, by Julie Melbin.
  3872.     Patches to support OS/2 came from Charles Moschel and for Windows/NT
  3873.     from Joe Greer and Clark Morgan.  Clark Morgan and Greg McFarlane seem
  3874.     to run full regression tests on each new release, and always seem to
  3875.     find something to report.  Sean Ahern is also always dependable for
  3876.     finding a bug or two per release.  The reference.doc file supplied with
  3877.     Bram Moolenaar's excellent Vim editor was useful in unraveling some of
  3878.     the less obvious parts of :map functionality.  In addition, his
  3879.     implementation of digraph insertion was used directly in the creation
  3880.     of digraphs.rc.  Thanks to Jukka Keto for contributing the c-filt.c
  3881.     code.
  3882.  
  3883.     The initial changes to create vile from micro-Emacs were all done
  3884.     by Paul Fox (pgf@foxharp.boston.ma.us).  (By the way, he is not the
  3885.     Paul D. Fox that wrote the Crisp editor.)
  3886.  
  3887. Problems
  3888. --------
  3889.  
  3890.     Send bug reports to
  3891.         vile-bugs@foxharp.boston.ma.us
  3892.  
  3893.     Requests to be put on the announcement list should go to
  3894.         vile-announce-request@foxharp.boston.ma.us
  3895.  
  3896. Copyright 1995,1996,1997 by Paul Fox, Tom Dickey, and Kevin Buettner
  3897. --------------------------------------------------------------------
  3898.  $Header: /usr/build/vile/vile/RCS/vile.hlp,v 1.371 1998/10/03 02:42:01 tom Exp $
  3899.