home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / os2vile.zip / VILE.HLP < prev   
Text File  |  1993-02-03  |  50KB  |  1,174 lines

  1.  
  2. Getting along with vile
  3. -----------------------
  4.     Use Ctrl-D and Ctrl-U to scroll through this help information.
  5.  
  6.     Type Ctrl-O to make this the only window on the screen.
  7.     Type Ctrl-K to get rid of this window.
  8.  
  9.     The only vile commands described herein are those not 
  10.     present in vi, or differing greatly from those in vi.
  11.     There is a section at the bottom describing other differences
  12.     between vile and vi.
  13.  
  14.     First, to leave vile, use any of the following:
  15.         :q
  16.         :quit
  17.         :exit
  18.         :wq    (writes current buffer before quitting)
  19.         :q!    (quits without writing any changes!)
  20.         Q
  21.         :wwq or ZZ    (will write all changed buffers)
  22.         ^X-^C    (don't know why.  _They_ don't put in ":q" for _us_!
  23.              Actually, if ^C is your interrupt character, this
  24.              won't get you out of vile.)
  25.  
  26.     To get help (probably just this text), use any of:
  27.         :h
  28.         :help
  29.         ^X-^H
  30.         ^A-^H
  31.  
  32.     To get a complete list of all commands, type ":describe-bindings".
  33.     To get a list of all commands that contain the strings "name",
  34.     type ":apropos name".  These lists will show all command synonyms
  35.     and key sequences that are bound to the same function.
  36.     
  37.     You needn't type full command names -- type a few characters and
  38.     hit the space bar to perform command completion. 
  39.  
  40. General Remarks
  41. ---------------
  42.     Vile holds text in "buffers".  Usually, these correspond to a file
  43.     that you are editing, but not always.  For instance, a buffer
  44.     might be used to display this help text, or to hold the output
  45.     of a shell command that you have run.  Buffers have names, and
  46.     these usually match the names of the files they contain.
  47.  
  48.     Buffers are sometimes displayed in windows.  A buffer may be 
  49.     displayed in more than one window at the same time.  There is 
  50.     no such thing as a hidden window.  All existing windows are on 
  51.     the screen.  There may, however, be hidden buffers, which are not 
  52.     currently associated with any window.
  53.  
  54.     All yank/delete registers (the default unnamed register, the numbered
  55.     registers ("1-"9) that hold line-deletes, and the named registers
  56.     ("a-"z)) are global to the editor, and not attached to any single
  57.     buffer.  Thus you can delete text in one buffer and put it back in
  58.     another. 
  59.  
  60.     Undo operations are attached to a buffer, not a window.  Thus if
  61.     you have two windows to the same buffer, and make a change in one,
  62.     you can undo it in the other.
  63.  
  64.  
  65.  
  66. Buffer manipulation commands:  
  67. -----------------------------
  68.     _    Show a history list of the up to 9 most recently visited 
  69.         buffers.  Follow this command with a digit to select that
  70.         buffer, or simply repeat it ("__") as a synonym for "_1".
  71.         Modified buffers are preceded by a '*' in the history list.
  72.         There are many different ways to get the previous file:
  73.             __
  74.             _1
  75.             1_
  76.             :p
  77.             :e#
  78.             ^^   (ctrl-^)  (but many keyboards can't produce this)
  79.  
  80.     :e    Edit a file.  If the file is already in a buffer, that buffer
  81.         will be recalled into the current window.  This occurs as
  82.         follows: If the name given contains no path delimiters
  83.         (i.e.  slashes), then it will be compared to the existing
  84.         vile buffer names.  Failing that comparison (or if there
  85.         are any slashes in the name), the name will be stretched
  86.         into an absolute path, and will be compared to the existing
  87.         buffers' filenames.  In either case, the matching buffer
  88.         will be chosen.  If there are no such matches, the file
  89.         will be fetched from the filesystem.  This matching
  90.         technique introduces an ambiguity, since buffer names are
  91.         created from the last path component of filenames.  To
  92.         force vile to edit a file from the current directory whose
  93.         basename matches that of one that was edited elsewhere,
  94.         simply preface the name with "./".  For example, if you
  95.         edit "../Makefile" and later attempt to edit "Makefile",
  96.         vile will assume you are referring to the _buffer_ named
  97.         "Makefile".  To get the file in the current directory,
  98.         specify "./Makefile".
  99.  
  100.     :e!    Re-edit a file.  A different filename can be given, and the 
  101.         buffer name will change to match it.  This command is not as
  102.         necessary in vile as it is in vi, since multiple buffers may
  103.         have outstanding unwritten changes.
  104.  
  105.     ^X-e    Edit the file whose pathname appears under the cursor.  For
  106.         example, if you are editing a makefile, you could edit one
  107.         of the source files by placing the cursor at the start of
  108.         its name and using this command.
  109.  
  110.     :n    Go to the next buffer.  "next" means least recently used.
  111.         (The ":n file ..." version of the command is not supported.)
  112.  
  113.     :rename    Rename the current buffer.  Prompts for a new name.  Does
  114.         not affect the filename associated with the buffer.  Use ":f"
  115.         to do that.
  116.         This command is useful for renaming the "[Output]" buffer, if
  117.         you wish to preserve its contents, but run a new command. 
  118.  
  119.     :b    Edit a buffer.  Recalls the named buffer.  Does not look for
  120.         a file of that name.  Will find "invisible" buffers.
  121.  
  122.     :ki    Kill a buffer.  Remove the buffer and its contents from the
  123.         editor.  Will ask if changes to the buffer should be discarded.
  124.         Currently, a buffer that is being displayed cannot be killed.
  125.         
  126.     *    Display a list of all buffers, or make that display go away
  127.         if it's already present.  Leave your finger on the key, and
  128.         it's easy to create and destroy the list.  The buffers are
  129.         numbered; the numbers correspond to the history numbers
  130.         shown and used by the '_' command, described above.  (If
  131.         the buffer number is greater than 9, then the "nn_" form of
  132.         the '_' command must be used, since '_' will only accept a
  133.         single following digit.)  Note that since the buffer names
  134.         are displayed in order of use, the list can quickly grow
  135.         "stale" -- the numbers may be meaningless if buffer
  136.         switching has been done since the last display of the list. 
  137.  
  138.         The program version is also displayed with this command.
  139.  
  140.     ^A-*    Always display a list of all buffers.  Useful for updating the
  141.         list if it's already on the screen but may be out of date.
  142.         Any argument will cause the list to include _all_ buffers,
  143.         even those normally considered "invisible".  (For example,
  144.         macros are stored in "invisible" buffers.)
  145.  
  146. Window manipulation commands:  
  147. -----------------------------
  148.     ^X-2    Make Two windows.  Splits the current window in half. This
  149.         is the usual way to create a new window.
  150.     ^K or ^X-0    Get rid of (Kill) this window.
  151.     ^O or ^X-1    Make this the Only window on the screen.
  152.  
  153.     ^X-o    Move to the next window.
  154.     ^X-O    Move to the previous window.
  155.  
  156.     v    Make the current window smaller.
  157.     V    Make the current window larger.
  158.  
  159.     ^A-^D    Scroll the next window down half a screen.
  160.     ^A-^U    Scroll the next window up half a screen.
  161.     ^A-^E    Scroll the next window up one line.
  162.     ^A-^Y    Scroll the next window down one line.
  163.     (The previous four commands are useful when comparing two buffers.
  164.      Mnemonic -- think of them as affecting the "A"lternate window.)
  165.  
  166.     zH zM zL  These are synonyms for vi's 'z+', 'z.', and 'z-', which 
  167.         position the line holding the cursor at the top, middle, or
  168.         bottom of the screen, respectively.
  169.  
  170.     ^X-^R    Scroll the window right by 1/3 of a screen, or by the
  171.         number of lines specified.  Changes the "sideways" value.
  172.     ^X-^L    Scroll the window left by 1/3 of a screen, or by the
  173.         number of lines specified.  Changes the "sideways" value.
  174.  
  175.     If for some reason you can't get your screen set right via a
  176.     TERM variable, try the ":screen-rows" or ":screen-columns"
  177.     commands (which take their args (number of rows or columns
  178.     respectively) before you type the ":").
  179.  
  180. File manipulation commands:  
  181. ---------------------------
  182.     The usual ":e", ":r", ":f", ":w" commands are available, though only
  183.     ":e!" is available of the "!" options.  The ":r" command reads the
  184.     named file in after the current line.  To read a file before the
  185.     first line, use ":0r".
  186.  
  187.     The commands ":ww" and ":wwq" correspond roughly to ":w" and ":wq",
  188.     but they each write all modified buffers.
  189.     
  190.     As in vi, ranges of lines specified by line numbers (including '.',
  191.     '$', and '%' shorthands) or marks may precede these commands.  
  192.     Unlike vi, search patterns cannot be used as line specifiers.
  193.  
  194.     In addition, two non-"colon" commands have been added:
  195.  
  196.     ^R    Prompts for a filename, and then reads it in _above_ the
  197.         current line.  If a register is specified (e.g. "a^R ), 
  198.         the file is read into that named register, but not inserted 
  199.         into the current buffer.
  200.  
  201.     ^W    is a writing operator, which prompts for a filename, and 
  202.         writes the specified region to that file.  Like all operators,
  203.         if the command is repeated, as in ^W^W, then lines are 
  204.         affected.  Use 10^W^W to write 10 lines.
  205.  
  206.         If a register is specified (e.g. "a^W ) then the command 
  207.         is _not_ an operator, but writes the specified register to 
  208.         the named file.  
  209.  
  210. Shell Access
  211. ------------
  212.     Anywhere a filename is valid, a command name is also
  213.     valid, entered in the form "!shell-command".  The whole line is
  214.     handed to the shell, and the read or write operation is done on
  215.     the commands standard input or output, as appropriate.  Thus
  216.     you can type ":e !date" to edit a copy of today's date.
  217.  
  218.     The ": !cmd" shell escape works pretty much as it does in vi.
  219.     The command ":!!" will rerun the previous such shell command.
  220.  
  221.     The '!' operator works as a filter, as expected.
  222.     
  223.     In addition, the ^X-! command runs a shell command and captures
  224.     its output in a specific buffer, called "[Output]".  This is
  225.     almost identical to ":e !cmd", except that in that case the buffer
  226.     is named according to the command name.
  227.  
  228.     These output capture commands are most useful in conjunction with
  229.     the "error finder", '^X-^X', described below.
  230.  
  231.     On systems supporting job control, ^Z will suspend vile.
  232.  
  233. Text manipulation command:
  234. --------------------------
  235.     Remember, these are only the new or different commands.  The 
  236.     standard vi set should still work.
  237.  
  238.     Undo ("u") and line-undo ("U") are available for all commands.
  239.     They should be a little less capricious than their
  240.     vi counterparts, since they do not share the default yank register
  241.     for their operation.  Also, line-undo ("U") is available until
  242.     the next change anywhere in the file, rather than until you leave
  243.     the line.  Unfortunately, the cursor position after an undo may not 
  244.     always be the same as it would be in vi.
  245.  
  246.     The vi "global" command is present, in its non-interactive form
  247.     only.  So is the "substitute" command.  These both look pretty
  248.     different while they're being used than they do in vi, and since
  249.     the searching is done right after the pattern is entered, there
  250.     can be a long delay while you're trying to finish typing your
  251.     complete command.  You can type commands just as you would have
  252.     in vi, i.e. ":g/oldpat/s//newstring/" will work.  But you won't
  253.     see any of the '/' characters.  Try it-- you'll get the idea.
  254.     Line ranges are not possible on ":g", but they are on ":s".
  255.  
  256.     The ":v" counterpart to ":g" is not implemented.
  257.  
  258.     The ":g" command can be followed by any of l (list), p (print),
  259.     < (left shift), > (right shift), r (read file), d (delete),
  260.     L (lower case), U (upper case), ~ (flip case), put (append
  261.     yanked text), Put (prepend yanked text), s (substitute),
  262.     trim (trim trailing whitespace).  For example, ":g/pattern/Put"
  263.     will insert the contents of the default yank register just
  264.     above every line containing "pattern".   The ":g" command can
  265.     only be used over the entire file -- smaller regions are not
  266.     permitted.
  267.  
  268.     The substitute command can be followed by any of 'g', a digit, or
  269.     'p', to do the substitution for all occurrences, the n'th
  270.     occurrence, or to print the resulting line respectively.
  271.  
  272.     The ":&" and '&' commands work much as they do in vi, and repeat
  273.     the last substitution.  The '^A-&' command is a new operator (see
  274.     below), so it can work on regions: for example use '&}' to "repeat
  275.     the previous substitution over the rest of this paragraph".
  276.  
  277.     Operators
  278.     ---------
  279.     Vi has a class of commands known as "operators".  Operator
  280.     commands are always immediately followed by a motion command. 
  281.     The text affected by an operator is bounded by the initial
  282.     position, and the cursor position after the motion is
  283.     completed.  Thus the delete operator ('d') can be followed by
  284.     the word motion command ('w'), causing the next word to be
  285.     deleted.  The sequence "dG" will delete through the end of the
  286.     file, and "d/junk" will delete to the next occurrence of the
  287.     string "junk".  Operators can all be "stuttered" to affect
  288.     lines.  Thus "dd" deletes one line, "4dd" affects 4 lines,
  289.     etc. 
  290.  
  291.     Some operators in vile can be forced to affect whole lines,
  292.     though the motion wouldn't normally imply it, by using the ^X
  293.     form of the command.  For example, "d%" (assuming you are on a
  294.     curly brace) will delete a C-style block of code.  "^X-d%"
  295.     will delete that same area, plus anything else on the lines
  296.     containing the curly- brace endpoints.
  297.  
  298.     Note that some operators always affect whole lines, no matter
  299.     how the motion is specified.  For instance, "!w" will always
  300.     filter an entire line, and not just a single word. 
  301.  
  302.     There are several new operator commands:
  303.  
  304.     ^A-~    Is the operator form of the '~' command, so "^A-~~"
  305.         changes the case of all characters on the current
  306.         line, "^A-~w" does it to a word, "3^A-~}" does it for
  307.         3 paragraphs, etc.  (In vile, the simple '~' command
  308.         will take a repeat count, unlike some versions of vi.
  309.         If you wish it to be an operator, rebind '~' to the
  310.         "flip-til" command.)
  311.     ^A-u    Like ^A-~, but converts the region to upper case.
  312.     ^A-l    Like ^A-~, but converts the region to lower case.
  313.  
  314.     ^A-f Format the region based on the current fill column.  The
  315.         initial indentation of both the first and second lines of
  316.         each "paragraph" in the region are preserved, and all
  317.         subsequent lines get the second line's indentation.  This
  318.         makes indented/outdented paragraphs (like this one) work
  319.         correctly.  (This is intentionally _not_ the same behavior
  320.         obtained by using "!fmt", since that behavior is obviously
  321.         available elsewhere.)  The usual usage of this command is
  322.         "^A-f}", which reformats the current paragraph.  The
  323.         re-formatting begins again with each new paragraph, where a
  324.         paragraph has the same boundaries used by the '{' and '}'
  325.         commands -- i.e.  blank lines, or lines beginning in .I .L
  326.         .P .Q or .b.  This make is possible to use "3^A-f}" or
  327.         "^A-fG" to reformat multiple paragraphs.  The reformatting
  328.         operation know about both C and shell comments, and will
  329.         do the "right" thing with lines that start with '#' or '*'
  330.         characters.
  331.  
  332.     ^X-s    For every occurrence of a search string, put in a replace-
  333.         ment string.  This is similar to "s/pattern/replacement/g"
  334.         over the region.
  335.  
  336.     ^A-&    Is an operator in vile, similar to the traditional & command.
  337.         It repeats the last substitution over the specified region.
  338.         (Unlike the '&' command, this one will remember trailing
  339.         g, p, l, or numeric options.)
  340.  
  341.     ^X-d    Delete the region, including the lines it starts and ends on.
  342.     ^X-c    Change the region, including the lines it starts and ends on.
  343.     ^X-y    Yank the region, including the lines it starts and ends on.
  344.  
  345.     ^A-t    Trim trailing whitespace from all lines in the region.
  346.  
  347.     ^A-<SPACE> Convert tabs to spaces, using the current tabstop value.
  348.     ^A-<TAB>   Convert as many spaces to tabs as appropriate.
  349.  
  350.     Text insertion
  351.     --------------
  352.     ^X-p    Causes the previously yanked or deleted text, no matter
  353.         how it was obtained, to be inserted after the current line.
  354.         Usually text that did not consist of whole lines where it
  355.         came from is inserted immediately following the cursor.
  356.     ^X-P    As above, but the text is put before the current line.
  357.         Thus "dw" followed by a "p" command does a normal insertion
  358.         of the deleted word, whereas "^X-p" results in the word
  359.         being inserted on a line by itself.
  360.  
  361.     R    vi's overwrite mode is supported.  Note that the combination
  362.         of overwrite mode and the (ANSI) arrow keys can be used to
  363.         give a "picture drawing" mode of operation: anything you
  364.         type goes into the buffer without moving adjacent text, and
  365.         you can move around using the arrow keys without leaving
  366.         overwrite mode.  Hint: start with a buffer full of lines
  367.         that consist entirely of blanks (as opposed to blank
  368.         lines).
  369.  
  370.     Searching
  371.     ---------
  372.     ^X-/    Does a forward search for the "word" located under the
  373.         cursor.
  374.     ^X-?    Does a reverse search for the "word" located under the
  375.         cursor.
  376.     ^A-/    Does not do a search, but sets the search pattern to the
  377.         "word" under the cursor.  Useful for "picking up" a word
  378.         from one buffer, and searching for it in another.
  379.  
  380.     The following two commands may not always be present in vile,
  381.         depending on how it was built:
  382.     ^X-S    Incremental forward searching.  As you enter the search 
  383.         string, the cursor is advanced to the next match with 
  384.         what you've typed so far.  Use ^F and ^R to continue the
  385.         search forward or in reverse, using the current pattern.
  386.     ^X-R    As above, but in reverse.
  387.  
  388.     Tags
  389.     ----
  390.     Vile supports vi-style "tags" files.
  391.  
  392.     ":ta" or ":tag" allows you to enter a tagname to locate.  Changes
  393.         to that file and location.
  394.     ^]    Uses the identifier currently under the cursor as the 
  395.         tagname.
  396.     ^T or ^X-^] or ":pop" - pops to the file and location just previous
  397.         to the last tag command.
  398.     When one of these commands is used, vile will look for a file named
  399.     "tags" in the current directory, and load it into a hidden buffer
  400.     for use during tag searches.  This buffer is editable if you wish
  401.     (":e tags"), but will not appear in the buffer lists.  If a buffer
  402.     named "tags" is already available when a tag is first requested, it
  403.     will be used instead of a file called "tags", and of course will
  404.     remain visible.  If the ":ta" form of the command is used, tag
  405.     matches must be exact, unless "taglength" is set non-zero, in which
  406.     case the first tag matching that many characters will be used.
  407.     If your tags file is not named "tags", simply edit it and name the
  408.     buffer "tags" with the ":rename-buffer" command.
  409.  
  410.     ^A-o    Remove all blank lines containing or immediately following
  411.         the current line.
  412.  
  413. Miscellaneous commands
  414. ----------------------
  415.     ^X-^X    The "error finder".  Goes to the next file/line error pair 
  416.         specified in the last buffer captured from a command's
  417.         output.  This buffer is usually created with the ^X-! command.
  418.         For example, "-!cc -c junk.c" puts all of the compiler output
  419.         into the buffer named "[Output]".  Repeatedly hitting ^X-^X 
  420.         will position the editor at each error in turn, and will
  421.         eventually start over again at the top.  The "Entering directory
  422.         XXX" and "Leavind directory XXX" messages that GNU make puts
  423.         out with the -w switch are honored, so that files are found
  424.         with the correct path.  (Tip: I use the following
  425.         macro to quickly grep a source directory for the string under
  426.         the cursor:
  427.             use-register g load-register "^X!egrep -n : *.[chs]^M"
  428.         where the ^X and ^M are each single control characters, entered
  429.         using ^V to escape them.  Then I invoke with @g to execute.)
  430.     ^X-t Set or report on the tab-stop width.  To set, the spacing must
  431.         precede the command, as in "4^X-t".  The "set tabstop"
  432.         command described below does the same thing.  The status
  433.         output indicates whether the buffer is currently using the
  434.         local or global copy of the tabstop value.
  435.     ^X-f Set the local fill-column to be used with ^A-f and auto-wrap
  436.         mode on insert.  The default value is 7/8's of the screen
  437.         size, with a maximum of 70.  Since arguments come before
  438.         commands, you type: 65^X-f.  The "set fillcol" command does
  439.         the same thing.  The status output indicates whether the
  440.         buffer is currently using the local or global copy of the
  441.         tabstop value.
  442.     ^X-x    Set encryption key. (not well tested, but hopefully not broken)
  443.         CRYPT must have been on when vile was built for this to do
  444.         anything.
  445.     K    Count prefix.  The first time you type it, it is equivalent
  446.         to an argument of 4 to the following command.  If you repeat 
  447.         it, it becomes worth 16, the next time 64, etc...  
  448.     %    In addition to finding matching braces, brackets, and
  449.         parentheses, the '%' command will find matching #ifdef's and
  450.         C style comments.  If the cursor is on the # of "#ifdef", the '%' command will
  451.         find the matching "#endif" or "#else".  On an "#else" it will
  452.         find "#endif", and on "#endif" it will go back up to the "#if".
  453.         If the cursor is on any part of a "/*" or "*/" sequence, it
  454.         will find the appropriate corresponding C comment endpoint.
  455.  
  456. Editor modes
  457. ------------
  458.     Modes are associated with either windows or buffers, and are
  459.     usually inherited from a set of global modes.  The value of the
  460.     mode will track changes to the global modes, until the "local"
  461.     value is set independently of the global one.  To set or change a
  462.     global mode, use ":set", to remove the mode, use ":unset",
  463.     ":setno", or ":set" with the modename prefixed with "no".  To set
  464.     and reset local modes, use ":setl", ":unsetl", ":setlno".  To
  465.     display modes, use ":setall", ":modes", ":set all".  Local values
  466.     are only shown if they differ from the global values, whether they
  467.     have been independently set or not.  The possible modes (with
  468.     synonyms in parentheses, and a trailing B or W indicating whether
  469.     the mode belongs to buffers or windows) are:
  470.  
  471.     autoindent (ai) During insert, newly created lines inherit their
  472.         leading indent from the previous line in the buffer. (B)
  473.  
  474.     autosave (as) Automatic file saving.  Writes the file after every
  475.         256 characters of inserted text.  Other file changes are
  476.         not counted. (B)
  477.  
  478.     cmode    C-code mode..  Maintains current indentation level
  479.         automatically during insert, like autoindent, above.  If a
  480.         line ends with a '{' or a ':', then the next line indents
  481.         further.  If a line begins with a '}', it is lined up with
  482.         the line containing its matching paired brace.  If a line
  483.         starts with '#' it is moved to column 1.  If the global
  484.         cmode is set, then the buffer's C mode is turned on
  485.         automatically only for files ending in a character from
  486.         c-suffixes.  Additionally, if a line begins with a '#'
  487.         character, it will not shift right with the '>>' command. (B)
  488.  
  489.     crypt    Causes files to be encrypted.  This is NOT compatible
  490.         with the UNIX crypt(1) routines. (B)
  491.  
  492.     c-shiftwidth (csw)  Will prompt for a new value for the shiftwidth
  493.         (see below) which will be used if a file is in cmode. (B)
  494.  
  495.     c-tabstop (cts)  Will prompt for a new value for spacing of tabstops
  496.         which will be used if a file is in cmode. (B)
  497.  
  498.     comments A regular expression defining commented paragraph
  499.         delimiters.  This is used in addition to the "paragraphs"
  500.         expression (see below) when reformatting a region.  The net
  501.         effect is that paragraphs inside of comments are preserved
  502.         when reformatting, but are not reachable with the '}' and
  503.         '{' motions.  (B)
  504.  
  505.     dos    When writing the buffer, terminate lines with CR/LF pairs,
  506.                 rather than the usual single LF.  On input, if the global
  507.         DOS mode is set, then incoming CR/LF pairs are taken as
  508.         line terminators, and the local DOS mode is set on the
  509.         buffer if the majority of lines ended that way.  If global
  510.         DOS mode is _not_ set, then incoming CR characters will be
  511.         visible on the screen.  Setting this makes editing binary
  512.         files unreliable.  (B)
  513.  
  514.     fillcol (fc) Will prompt for a new value for the fill column, where
  515.         auto-wrapping and region formatting will break lines. (B)
  516.  
  517.     ignorecase (ic) Text searches normally match the pattern exactly.
  518.         With this set, searches are case-insensitive. (B)
  519.  
  520.     list    (li) The buffer will be displayed with tabs and newlines made
  521.         visible, instead of as whitespace. (W)
  522.  
  523.     magic    Allow meta-characters in search strings.  See the section 
  524.         "Regular Expressions" for more detail. (B)
  525.  
  526.     paragraphs A regular expression defining where the "next-paragraph"
  527.         ('}') and "previous-paragraph" ('{') commands will go. (B)
  528.  
  529.     sections A regular expression defining where the "next-section" (']')
  530.         and "previous-section" ('[') commands will go. (B)
  531.  
  532.     shiftwidth (sw) This is much like a tabstop, except that it is
  533.         independent of hardware tabs and tab characters.  It is the
  534.         number of columns a line will shift by if the '<<' or '>>'
  535.         commands are used, and it chooses the next column stop for
  536.         the cursor if a '^T' or '^D' is typed during insert mode.
  537.  
  538.     showmatch (sm) During insert, if a closing '}', ']', or ')' character
  539.         is typed, the cursor will highlight the matching member
  540.         of the pair for about a quarter second. (B)
  541.  
  542.     showmode (smd) Causes an indicator on the modeline to indicate what
  543.         mode vile is currently in: insert (I), replace (R), or
  544.         command (none).  (B)
  545.  
  546.     sideways  Will prompt for a new value for the sideways scroll offset,
  547.         which allow display of a section of code normally off the
  548.         screen to the right.  Also affected by the ^X-^R and ^X-^L
  549.         commands.  (W)
  550.  
  551.     tabinsert (ti) Allow the physical insertion of tab characters into
  552.         the buffer.  If "notabinsert", and an attempt is made to
  553.         insert a tab character by explicitly typing it or by using
  554.         shiftwidth or the line shifting commands, then the
  555.         appropriate number of space characters will be inserted
  556.         instead.  Use '^V^I' to insert a real tab, and remember
  557.                 that pre-existing tabs will not be affected.  Use '^A-SP'
  558.                 to eliminate pre-existing tabs from a region of text. (B)
  559.  
  560.     tabstop (ts) Will prompt for a new value for spacing of normal
  561.         tabstops. (B)
  562.  
  563.     taglength (tl) Sets the significant length for tags.  If non-zero,
  564.         the first tag matching in that many characters will be used,
  565.         otherwise, tags must match the lookup pattern exactly.  This
  566.         will not effect tags picked up from the cursor -- they are
  567.         always matched exactly. (B)
  568.  
  569.     tagrelative (tr) Causes files looked up via the tags mechanism to
  570.         be found relative to the location of the tags file, rather
  571.         than relative to the current directory. (B)
  572.  
  573.     terse   vile produces more "status" messages than vi, which may
  574.         become annoying at low baud rates.  Setting terse mode will
  575.         suppress many of these.  (B)
  576.  
  577.     wrapscan (ws) Text searches will continue from past the bottom of
  578.         the file to the top, and vice-versa.  (B)
  579.  
  580.     wrapwords (ww) Similar to vi's auto-wrap mode.  While inserting,
  581.         words are moved to the next line if the current line gets
  582.         too long.  Unlike vi, wrapping is only attempted when a
  583.         space is typed. (B)
  584.  
  585.     view    View the file only.  No changes are permitted.  This is set
  586.         automatically for the output of shell commands.  (B)
  587.  
  588. Special Character Expansion
  589. ---------------------------
  590.  
  591.     As in vi, the % and # characters typed while responding to a prompt
  592.     will expand to the current or "alternate" filename.  In addition,
  593.     the colon character (":") expands to the identifier name under the
  594.     cursor.  Expansion of ! to the last command run is not implemented.
  595.     The expansion can be suppressed by prefixing with a '\'.
  596.  
  597. Key Rebinding
  598. -------------
  599.  
  600.     The vi "map", "map!", and "abbr" commands are not currently supported.
  601.  
  602.     There is a key rebinding facility (if vile is built to include it),
  603.     which is invoked as follows.  One must know the "english" name for the
  604.     command being rebound.  Use ":describe-bindings" or ":apropos string"
  605.     to find englishnames containing "string".  Then use the command:
  606.         ":bind-key englishname keyseq"
  607.     where keyseq is the exact keyboard sequence (i.e. single character,
  608.     or ^X or ^A followed by a single character) to which the
  609.     command should be bound.  In a .vilerc file, keyseq should be the
  610.     printable representation of the sequence, e.g. ^A-a or ^X-S.
  611.  
  612.     Commands can be bound to function keys, which are either ANSI
  613.     escape sequences of the form "ESC [ c" or "ESC O c".  Thus the ANSI
  614.     up-arrow key, which produces "ESC [ A" is bindable as 'FN-A' (and
  615.     is bound to "previous-line" by default), and the 4 ANSI function
  616.     keys, which produce "ESC O P" through "ESC O S" (and sometimes
  617.     more) are bound to 'FN-P', 'FN-Q', 'FN-R', and 'FN-S'.
  618.  
  619.     Any "function" key is available on any terminal using the '#'
  620.     prefix.  Entering the sequence "# A" is equivalent to hitting
  621.     the ANSI up-arrow in the above paragraph, and hitting "# 3" will
  622.     execute whatever is bound to 'FN-3' (which is "execute-macro-3"
  623.     by default.
  624.  
  625.     Examples:
  626.      To cause the / and ? commands to perform incremental
  627.       searches, use:
  628.         bind-key incremental-search /
  629.         bind-key reverse-incremental-search ?
  630.      To make ^N and ^P switch windows instead of cause motion by lines,
  631.        try:
  632.         bind-key next-window ^N
  633.         bind-key previous-window ^P
  634.      To cause the space bar to move forward by pages, as in the "more"
  635.       command, use:
  636.         bind-key next-page <sp>
  637.  
  638.     (Space and tab can be represented with the strings: "<sp>" and 
  639.     "<tab>".)  The englishname "rebind-key" is synonymous with "bind-key".
  640.  
  641.     Note that even the ^A and ^X prefix characters can be rebound, using
  642.     the dummy functions "cntl_a-prefix" and "cntl_x-prefix".  Even
  643.     if they are rebound, however, the binding list and bind-key
  644.     commands will refer to them as ^A and ^X.
  645.  
  646.     Note that when interactive, ^A is typed using the control key.  In a
  647.     file, however, it should be a caret (^) followed by a letter.
  648.  
  649.  
  650. Macros
  651. ------
  652.     The first type of macro in vile, is for temporary, quick macro
  653.     usage, and lets you record a macro as you execute vile commands.
  654.     You can then replay those keystrokes with a single key. 
  655.  
  656.     ^X-(    Begin recording a keyboard macro.  The keystrokes you type
  657.         are recorded, until you use ^X-).
  658.     ^X-)    Finish recording a keyboard macro.
  659.     ^X-&    Execute the keyboard macro.
  660.  
  661.     The vi '@' command is present as well, and can be used to execute
  662.     the contents of a named register as if it were entered at the
  663.     keyboard.  To make this more useful, the "load-register" command
  664.     will allow preloading a named register, from .vilerc file.  For
  665.     example:
  666.         use-register a load-register ihello^[
  667.     will load register 'a' with a command to insert the word "hello".
  668.     (The ^[ should be a real ESC character, entered by preceding it
  669.     with ^V.)  A better example, is this:
  670.         use-register w load-register ":!chmod +w %^M:w^M"
  671.     which makes the current file writable and writes it.  (Again, use
  672.     ^V to get the CR characters into the .vilerc file.)
  673.  
  674. Programmed macros
  675. -----------------
  676.     Vile can also be extended (though I confess this has only been
  677.     lightly used or tested) by defining macros and then binding
  678.     execution of those macros to key sequences.  For example, if
  679.     the following lines appear in a .vilerc file:
  680.         1 store-macro
  681.          5 delete-til next-word
  682.         ~endm
  683.         bind-key execute-macro-1 ^A-1
  684.     then when ^A-1 is executed, 5 words will be deleted.  The "-til"
  685.     suffix on an englishname denotes that it is a vi operator style
  686.     command, and expects to be followed by a motion command.  Also,
  687.         1 store-macro
  688.          5 delete-til lines
  689.         ~endm
  690.     would be the equivalent of "5dd" since the word "lines" represents
  691.     the stuttered 'dd' style of operation.
  692.  
  693.     There are some built-in variables that can be used in macros to
  694.     gain access to parts of vile status, and parts of the current
  695.     buffer.  Built-in variables are accessed by name, prefixed with
  696.     the '$' character.  (User-defined variables can also be set and
  697.     used; their names are prefixed with the '%' character.)
  698.  
  699.     $pagelen    number of screen lines in use by editor
  700.     $pagewid    current screen width
  701.     $curcol        current column position of cursor
  702.     $curline    current line in file
  703.     $cbufname    current buffer name
  704.     $cfilname    current file name
  705.     $sres        current screen resolution
  706.     $debug        macro debugging -- set true for line by line tracing
  707.     $status        returns the status of the last command
  708.     $palette    current palette string
  709.     $lastkey    last keyboard char struck
  710.     $version    current version number            (read-only)
  711.     $progname    returns current prog name - "vile"    (read-only)
  712.     $seed        current random number seed
  713.     $discmd        display commands on command line
  714.     $disinp        display command line input characters
  715.     $wline        number of lines in current window
  716.     $cwline        line offset in current window
  717.     $search        search pattern
  718.     $replace    replacement pattern
  719.     $match        last matched magic pattern        (read only)
  720.     $kill        some of the kill register        (read only)
  721.     $tpause        length to pause for paren matching (pc versions)
  722.     $pending    typeahead pending flag            (read only)
  723.     $llength    length of current line            (read only)
  724.     $char        character under the cursor
  725.     $line        text of current line
  726.     $word        current "word"
  727.     $identifier    current punctuated word
  728.     $qidentifier    current qualified name (as with C++ ::)
  729.     $pathname    current path-like word
  730.     $directory    current directory
  731.     $terse        be terse -- suppress messages
  732.     $font        current font name (X version only)
  733.  
  734.     There are also functions available, which can act on
  735.     those variables, or on hard-coded values.  Operations are expressed
  736.     in prefix notation, so to add to numbers you would say "&add 3 5".
  737.  
  738.     func    no. of
  739.     name    args
  740.     --------------
  741.     &add    2    add two numbers together
  742.     &sub    2    subtraction
  743.     &tim    2    multiplication
  744.     &div    2    division
  745.     &mod    2    modulus
  746.     &neg    1    negate
  747.     &cat    2    concatenate string
  748.     &lef    2    left string(string, len)
  749.     &rig    2    right string(string, pos)
  750.     &mid    3    mid string(string, pos, len)
  751.     ¬    1    logical not
  752.     &equ    2    logical equality
  753.     &les    2    logical less than
  754.     &gre    2    logical greater than
  755.     &seq    2    string logical equality check
  756.     &sle    2    string logical less than
  757.     &sgr    2    string logical greater than
  758.     &ind    1    evaluate indirect value
  759.     &and    2    logical and
  760.     &or     2    logical or
  761.     &len    1    string length
  762.     &upp    1    uppercase string
  763.     &low    1    lower case string
  764.     &tru    1    Truth of the universe logical test
  765.     &asc    1    char to integer conversion
  766.     &chr    1    integer to char conversion
  767.     >k    0    get 1 character
  768.     &rnd    1    get a random number from 1 to n
  769.     &abs    1    absolute value of a number
  770.     &sin    2    find the index of one string in another
  771.     &env    1    retrieve a system environment var
  772.     &bin    1    lookup what function name is bound to key
  773.     &rd    1    is a file readable
  774.     &wr    1    is a file writable
  775.  
  776.     To prevent vile from thinking that a failed command is an error in
  777.     the macro, you can put "~force" in front of it.  So, to write a
  778.     macro which will run the "man" command on the identifier under the
  779.     cursor, where you don't really consider it an error if the command
  780.     fails, you might use:
  781.  
  782.         9 store-macro
  783.             ~force shell-command &cat "man " $identifier
  784.         ~endm
  785.         bind-key execute-macro-9 ^X-m
  786.  
  787.     The "screen-search-forward" command could be re-implemented as:
  788.         10 store-macro
  789.             ~force search-forward $identifier
  790.         ~endm
  791.         bind-key execute-macro-10 ^X-/
  792.  
  793.     And the "screen-search-pattern-grab" command, normally bound to
  794.     ^A-/, could be implemented with:
  795.         11 store-macro
  796.             set-variable $search $identifier
  797.             write-message &cat "Search pattern is now " $search
  798.         ~endm
  799.         bind-key execute-macro-11 ^A-/
  800.  
  801.     A variation, which will not find the identifier if it is a substring
  802.     of another word, is:
  803.         12 store-macro
  804.             ~force search-forward &cat "\\<" &cat $identifier "\\>"
  805.         ~endm
  806.     This works by surrounding the string with the \< and \> meta-
  807.     characters.
  808.  
  809.     Primitive flow-of-control within a macro may be obtained with
  810.     certain directives.  Macro directives start with a "~" and include:
  811.  
  812.     ~if cond    conditional execution
  813.     ~else
  814.     ~endif
  815.     ~return        Return (terminating current macro)
  816.     ~goto *label    Jump to a label in the current macro
  817.     ~force        Force macro to continue...even if command fails
  818.     ~while cond    Execute a loop if the condition is true
  819.     ~break
  820.     ~endwhile
  821.     
  822.     ~endm        End a macro
  823.  
  824.     Line Labels begin with a "*" as the first nonblank char, like:
  825.  
  826.     *LBL01
  827.  
  828.     Note that for simple key-remappings, binding is often preferable
  829.     to creating a macro.  Some people prefer using lower-case 'g' to
  830.     as an equivalent to 'G', to goto a specific line.  If done as a
  831.     macro, like this:
  832.  
  833.         3 store-macro
  834.             goto-line
  835.         ~endm
  836.         bind-key execute-macro-3 g
  837.  
  838.     then both g and G go to the end of the file, but whereas 1000G goes
  839.     to line 1000, 1000g goes to the end of the file 1000 times.  It is
  840.     easier (and works correctly) to do:
  841.  
  842.         bind-key goto-line g
  843.  
  844. Regular Expressions
  845. -------------------
  846.     Searches use regular expressions, which, as in vi, may be magic
  847.     by default or not.
  848.  
  849.     There are new magic metacharacters.
  850.  
  851.     The code that implements the expressions is based directly on
  852.     Henry Spencer's regexp code.  Quoting from the original man page:
  853.  
  854.     "A regular expression is zero or more branches, separated by `\|'. 
  855.     It matches anything that matches one of the branches."
  856.  
  857.     "A branch is zero or more pieces, concatenated.  It matches a match
  858.     for the first, followed by a match for the second, etc."
  859.  
  860.     "A piece is an atom possibly followed by `*', `\+', or `\?'.  An atom
  861.     followed by `*' matches a sequence of 0 or more matches of the
  862.     atom.  An atom followed by `\+' matches a sequence of 1 or more
  863.     matches of the atom.  An atom followed by `\?' matches a match of
  864.     the atom, or the null string." [i.e., `\?' matches 0 or 1 occurrences]
  865.  
  866.     "An atom is a regular expression in backslashed parentheses
  867.     (matching a match for the regular expression), a range (see below),
  868.     `.' (matching any single character), `^' (matching the null string
  869.     at the beginning of the input string), `$' (matching the null
  870.     string at the end of the input string), a `\' followed by a single
  871.     character (matching that character), or a single character with no
  872.     other significance (matching that character)." [ In addition, vile
  873.     atoms may be: \< and \>, which match the beginning and end of a
  874.     "word", \s and \S, which match sequences of whitespace and
  875.     "darkspace", \w and \W, which match alphanumerics (including '_')
  876.     and non-alphanumerics, \d and \D, which match digits and
  877.     non-digits, and \p and \P, which match printable and non-printable
  878.     characters (whitespace is printable).  (Note: only \s will match the
  879.     start or end of a line (since newlines count as whitespace), but
  880.     since no vile regular expression will span more than one line, it
  881.     will not _cross_ the newline.) ]
  882.  
  883.     "A range is a sequence of characters enclosed in `[]'.  It normally
  884.     matches any single character from the sequence.  If the sequence
  885.     begins with `^', it matches any single character not from the
  886.     rest of the sequence.  If two characters in the sequence are
  887.     separated by `-', this is shorthand for the full list of ASCII
  888.     characters between them (e.g.  `[0-9]' matches any decimal digit). 
  889.     To include a literal `]' in the sequence, make it the first
  890.     character (following a possible `^').  To include a literal `-',
  891.     make it the first or last character."
  892.  
  893.     Additionally for vile, if "ignorecase" is set, then all literal
  894.     matches, including those in character classes, are done without
  895.     regard to upper and lower case.
  896.  
  897.     In magic mode, the following set of metacharacters
  898.     must be preceded by '\' to hide their special meaning:
  899.         * [ . ^ $
  900.     These characters are special if they _are_ preceded with a '\':
  901.         ? + ( ) | < >
  902.  
  903.     If magic mode is _not_ on, only ^ and $ are special if not escaped. 
  904.     All of the following must be preceded with a '\' to be special,
  905.     otherwise they are taken literally:
  906.         ? + ( ) | * [ . < >
  907.  
  908. Command files
  909. -------------
  910.     On startup (in the absence of '@' arguments -- see Invocation
  911.     below), vile will attempt to read the file ".vilerc" in the current
  912.     directory, and then in $HOME, and will execute the commands found
  913.     therein.  It is possible to nest such executions.  For example, you
  914.     might keep your general default settings in your home directory,
  915.     and put the following lines in a .vilerc in a directory in which
  916.     you prefer tabs be set to 4 spaces:
  917.  
  918.         source "$HOME/.vilerc"
  919.         set tabstop 8
  920.  
  921.     The quotes surrounding the filename part are necessary to
  922.     protect the name from interpretation as a vile variable. 
  923.  
  924.     Files can be executed at any time with the ":source" (or
  925.     ":execute-file") command.  There are (mostly untested) control
  926.     structures available, such as ~while, ~if, etc.  Refer to the
  927.     source code for more information.
  928.  
  929.     Nesting of source'd files is limited to a depth of ten, to prevent
  930.     infinite recursion.
  931.  
  932.     The ';' character can be used as a comment character in command
  933.     files.
  934.  
  935. Invocation
  936. ----------
  937.     If set in the environment, the variable VILEINIT is used as a set
  938.     of vile commands to initialize the editor.  If unset, vile looks
  939.     for files called "./.vilerc" and "$HOME/.vilerc, and executes the
  940.     first one found.  As a not-very-useful example of a VILEINIT
  941.     sequence, the following setting will exactly recreate the default
  942.     (i.e. no VILEINIT variable) behavior:
  943.  
  944.         export VILEINIT
  945.         VILEINIT="
  946.         ~if &rd \"./.vilerc\"
  947.             source \"./.vilerc\"
  948.         ~else
  949.             ~if &rd \"$HOME/.vilerc\"
  950.                 source \"$HOME/.vilerc\"
  951.             ~endif
  952.         ~endif"
  953.  
  954.  
  955.     The command line options are fairly straightforward.  Vile does not
  956.     support running _any_ command after a '+', as does vi, but does
  957.     support the commonly used '+400' to go to line 400 and '+/foo' to
  958.     search for foo.  Command files (see below) can be explicitly
  959.     executed on startup by prefixing them with the '@' character, as in
  960.     "vile @mycmds file.c".  This will suppress the operation of VILEINIT
  961.     and the .vilerc files.
  962.  
  963.     Use "vile -?" to get the usage message.
  964.  
  965. X Window System specifics:
  966. -------------------------
  967.  
  968.     If you are using xvile, the following additions are available:
  969.  
  970.     Mouse buttons:
  971.  
  972.     1 -    Sets cursor position and the start of the selection.
  973.         With any modifier, it will center the buffer at the cursor
  974.         (this results in a primitive form of scrolling.)
  975.         Motion with the button down will select text.
  976.         Multiple clicks will expand the selection to cover
  977.         words or the current line.
  978.     2 -    Paste the current PRIMARY selection.  With a modifier, it
  979.         pastes at the mouse position, otherwise it pastes at
  980.         the text cursor position.
  981.     3 -    Extends the current selection.
  982.  
  983.     Additional command line arguments:
  984.  
  985.     -f fontname    Font to use.
  986.     -r         Use reverse video.
  987.     -d display    Use an alternate display.
  988.     -fg color    change foreground color (or -foreground)
  989.     -bg color    change background color (or -background)
  990.     -name name    change window name
  991.  
  992.     X Resources:
  993.  
  994.     font        Font to use.
  995.     charClass    Character classes for multiple click selections.
  996.             The format is identical to that of xterm(1).
  997.     multiClickTime    How long between clicks (in milliseconds) to
  998.             be accepted as a multi-click.
  999.  
  1000.     Changing the font on the fly:
  1001.  
  1002.     Use the ':setv' command to set the $font variable:
  1003.  
  1004.     : setv $font <fontname>
  1005.  
  1006. DOS specifics
  1007. -------------
  1008.     You can force vile into one of three screen modes: 25, 43 and 50
  1009.     lines.  It auto-senses, but can be overridden with a command
  1010.     line option: -2, -4, and -5 give 25, 43 and 50 lines respectively.
  1011.  
  1012.     If you shell out in 50 line mode, make sure you are in 50 line mode
  1013.     before you exit the dos shell, otherwise you end up with a 50 line
  1014.     edit window with only the top 25 displayed.
  1015.  
  1016.     The vile.rc file can be located in the same directory as your
  1017.     binary executable, since vile searches the PATH for this file.
  1018.  
  1019. Differences from vi
  1020. -------------------
  1021.     Of course, this really isn't vi.  Some of the following differences
  1022.     deserve changing, others do not.
  1023.  
  1024.     The parser for the ':' commands is not very vi-like.  For instance,
  1025.     ":e" will prompt you for a file name.  Most commands remember their
  1026.     last argument, and will present it as the default reply to their
  1027.     prompt. 
  1028.  
  1029.     The backspace, line kill, word kill, job control, etc.  characters
  1030.     are not rebindable.  They are, however, read from the tty settings
  1031.     on startup.
  1032.  
  1033.     There is no expansion of ! in filenames or shell escapes.  The
  1034.     command ":!!" does rerun the previous shell command.  Occurrences of
  1035.     '#' and '%' are recognized and expanded to the previous or current
  1036.     filename.  Other punctuation (e.g.  '~') may be expanded by your
  1037.     shell (sh, csh), since it is handed filenames for expansion if they
  1038.     contain any of these characters: * ? ~ [ ] $ { }
  1039.  
  1040.     Paragraph and section boundaries, for the {, }, [, and ] commands
  1041.     are configurable, but may not exactly match those in vi.  They
  1042.     are expressed via regular expressions.
  1043.  
  1044.     The vi ":map", ":map!", and ":abbr" are not supported.
  1045.  
  1046.     There is no special lisp support.  But then, when was the last time
  1047.     you heard of a lisp programmer that used vi?
  1048.  
  1049.     Of course, ex and open mode aren't there.
  1050.  
  1051.     Most, but not all, of the word-motion-with-operator and end-of-line 
  1052.     anomalies have been recreated.  One missing anomaly: In vile, "dw"
  1053.     on the last word of a line ending in whitespace deletes the
  1054.     trailing whitespace.  Vi does not delete the whitespace. 
  1055.  
  1056.     If you use "cd" to change directories, all buffers whose filenames
  1057.     do not already begin with '/' will be made absolute, by prepending
  1058.     the current directory name to the filename.
  1059.  
  1060. Sample .vilerc
  1061. --------------
  1062.     Here's a sample .vilerc, to help get you started with the
  1063.     syntax and style of vile macros:
  1064.  
  1065.     set autoindent
  1066.     set fillcol 75
  1067.     set cmode
  1068.     set c-tabstop 4
  1069.     
  1070.     ; sitting on a brace, run the C code block through indent
  1071.     1 store-macro
  1072.         write-file 
  1073.         filter-til goto-matching-fence "indent -st"
  1074.     ~endm
  1075.  
  1076.     
  1077.     ; format the current paragraph
  1078.     2 store-macro
  1079.         previous-paragraph 
  1080.         filter-til next-paragraph "/usr/ucb/fmt"
  1081.     ~endm
  1082.     
  1083.     ; put 'fprintf(stderr,"\n");" into the file, and
  1084.     ; position the cursor to add to the string
  1085.     3 store-macro
  1086.         ~force next-line
  1087.         beginning-of-line
  1088.         insert-string "fprintf(stderr, \"\\n\");\n"
  1089.         ; six back, because it counts the newline
  1090.         6 backward-character
  1091.         insert-chars
  1092.     ~endm
  1093.     
  1094.     ; insert '> ' in front of every line from here til the end
  1095.     ; (this works because without argument, the default action 
  1096.     ; for "goto-line" is to go to the end of file.
  1097.     4 store-macro
  1098.         substitute-til goto-line "^" "> "
  1099.     ~endm
  1100.  
  1101.     ; the next three reproduce vile version three behavior
  1102.     bind-key next-window ^N
  1103.     bind-key previous-window ^P
  1104.     bind-key split-current-window ^T
  1105.     
  1106.     bind-key execute-macro-1 ^A-C
  1107.     bind-key execute-macro-2 ^A-F
  1108.     bind-key execute-macro-3 ^A-K
  1109.     bind-key execute-macro-4 ^A-M
  1110.  
  1111. Note on Scrolling
  1112. -----------------
  1113.     If scrolling is really slow, or really ugly (the status line hops
  1114.     around a lot), and you're using a vt102 or compatible terminal that
  1115.     you think should be able to scroll okay, then the problem is almost
  1116.     certainly your termcap entry, which probably doesn't describe the
  1117.     scrolling regions adequately.  Most standard termcap entries are
  1118.     insufficient.  Here's one that should work:
  1119.  
  1120.         dy|vt102|vt-102|dec vt102:\
  1121.             :do=^J:co#80:li#24:cl=50\E[;H\E[2J:\
  1122.             :le=^H:bs:cm=5\E[%i%d;%dH:nd=2\E[C:up=2\E[A:\
  1123.             :ce=3\E[K:cd=50\E[J:so=2\E[7m:se=2\E[m:us=2\E[4m:ue=2\E[m:\
  1124.             :md=2\E[1m:mr=2\E[7m:mb=2\E[5m:me=2\E[m:is=\E[1;24r\E[24;1H:\
  1125.             :rs=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:ks=\E[?1h\E=:ke=\E[?1l\E>:\
  1126.             :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\
  1127.             :ho=\E[H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:pt:sr=5\EM:vt#3:\
  1128.             :sc=\E7:rc=\E8:cs=\E[%i%d;%dr:vs=\E[?7l:ve=\E[?7h:
  1129.  
  1130.     The crucial entries are cs and sr -- without both of them,
  1131.     vile will attempt to use dl and al, and will scroll by
  1132.     deleting and inserting a block of lines, giving the ugly
  1133.     behavior you see.  If you define PRETTIER_SCROLL when building
  1134.     vile, it will alternately delete and insert lines, instead of
  1135.     deleting them all and then inserting them all.  This makes it
  1136.     look a _little_ better, but it's slower.
  1137.  
  1138.     ( The terminfo entry equivalent to the above termcap entry:
  1139.  
  1140.     vt102|vt-102|dec vt102,
  1141.         xon,
  1142.         cols#80, lines#24, vt#3,
  1143.         bel=^G, blink=\E[5m$<2>, bold=\E[1m$<2>,
  1144.         clear=\E[;H\E[2J$<50>, cnorm=\E[?7h, cr=\r,
  1145.         csr=\E[%i%p1%d;%p2%dr, cub1=\b, cud1=\n,
  1146.         cuf1=\E[C$<2>, cup=\E[%i%p1%d;%p2%dH$<5>,
  1147.         cuu1=\E[A$<2>, cvvis=\E[?7l, ed=\E[J$<50>,
  1148.         el=\E[K$<3>, home=\E[H, ht=\t, ind=\n,
  1149.         is2=\E[1;24r\E[24;1H, kbs=\b, kcub1=\EOD, kcud1=\EOB,
  1150.         kcuf1=\EOC, kcuu1=\EOA, kf1=\EOP, kf2=\EOQ, kf3=\EOR,
  1151.         kf4=\EOS, rc=\E8, rev=\E[7m$<2>, ri=\EM$<5>,
  1152.         rmkx=\E[?1l\E>, rmso=\E[m$<2>, rmul=\E[m$<2>,
  1153.         rs2=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7,
  1154.         sgr0=\E[m$<2>, smkx=\E[?1h\E=, smso=\E[7m$<2>,
  1155.         smul=\E[4m$<2>,
  1156.     )
  1157.  
  1158. Credits
  1159. -------
  1160.     This code has been written by a _lot_ of people.  Names appearing
  1161.     within comments in the micro-Emacs source code are: Dave
  1162.     Conroy, Daniel Lawrence, John Gamble, Roger Ove, Dana Hoggatt,
  1163.     Jon Reid, Steve Wilhite, George Jones, Adam Fritz, D.R.Banks,
  1164.     Bob McNamara.  In addition, some of the "ex" code is by Steve
  1165.     Kirkendall, author of the vi clone called "elvis".  The regular
  1166.     expression code and documentation is by Henry Spencer.  The sample
  1167.     .vilerc was created by Dave Lemke; he also contributed code for
  1168.     new features and bug fixes.  Eric Krohn has done some excellent
  1169.     testing and enhancement.  The changes to create vile from
  1170.     micro-Emacs were all done by Paul Fox, who can be reached at
  1171.     pgf@cayman.com.  (By the way, this is not the same Paul Fox that
  1172.     did the Crisp editor.)
  1173.  
  1174.