home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / vil55os2.zip / vile.hlp < prev   
Text File  |  1995-11-21  |  138KB  |  3,258 lines

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