Use Ctrl-D and Ctrl-U to scroll through this help information.
Type Ctrl-O to make this the only window on the screen. Type Ctrl-K to get rid of this window.
First, to leave vile, use any of the following:
To get help (probably just this text), use any of:
:h :help ^X-h ^A-hThe only vile commands described herein are those not present in vi, or differing greatly from those in vi. There is a section at the bottom describing other differences between vile and vi.
To get a complete list of all commands, type ":show-commands". To get a list of all commands that contain the string "name", type ":apropos name". These lists will show all command synonyms and key sequences that are bound to the same function, along with a short description of the command, and whether it is a motion or operator command.
To get information on a specific key-binding or function, use the "describe-key" or "describe-function" commands. You will be asked for a keystroke or function name, and a short description will be shown.
You needn't type full command names -- type a few characters and hit TAB to perform command completion. Hitting a second TAB will pop up a window containing the list of possible completions.
If your screen hops around a lot when you scroll, see the "Note on Scrolling" section near the bottom of this file.
vile holds text in "buffers". Usually, these correspond to a file that you are editing, but not always. For instance, a buffer might be used to display this help text, or to hold the output of a shell command that you have run. Buffers have names, and these usually match the names of the files they contain.
Buffers are sometimes displayed in windows. A buffer may be displayed in more than one window at the same time. There is no such thing as a hidden window. All existing windows are on the screen. There may, however, be hidden buffers, which are not currently associated with any window.
All yank/delete registers (the default unnamed register, the numbered registers ("1-9") that hold line-deletes, and the named registers ("a-z")) are global to the editor, and not attached to any single buffer. Thus you can delete text in one buffer and put it back in another.
Undo operations are attached to a buffer, not a window. Thus if you have two windows to the same buffer, and make a change in one, you can undo it in the other.
vile supports many, many "modes" (aka options), which are thoroughly explained in the section entitled "Editor modes". But do note that this help file makes references to modes before the concept is fully described. It's a chicken and egg problem....
vile is 8-bit clean, allowing it to be used more easily at non- English speaking sites. See the section on "8-Bit Operation" for more information.
To extend the vi command set in vile, two (or three, depending on how you count them) command "prefixes" exist. These keystrokes, in combination with another key, can be bound as a pair to execute any vile function. The default values for these prefixes are
| Key: | Bound to dummy function: |
|---|---|
| ^X Control-X | cntl_x-prefix |
| ^A Control-A | cntl_a-prefix |
| # poundsign | function-prefix |
(The '#' key is used in vi to give terminal independent access to function key bindings. This is also true in vile -- if something is bound to '#2', then it is also probably available with key F2 on your keyboard.)
vile stores buffers in a sorted list. Depending on the setting of the "autobuffer" mode, this list is either sorted in "most-recently-used" order (this is the vile default), or in a fixed order dependent on the order of editing (this is how vi normally does it, and can be attained by turning "autobuffer" off, with "set noautobuffer").
The buffer number may also precede the '_' command. This is necessary when visiting buffers numbered higher than '9'. For example, one would type "13_" to visit buffer 13 in the list.
Use tab (or back-tab if supported) to scroll the list of 9 buffers right/left. Pressing '_' will select the first listed buffer; the 1-9 digits also work as expected when the list is scrolled.
[ See the note under "Differences", below, for comments on vi's use of '_'.]
^X-_1 does the trick (reverts to views "A" and "B"), but _1 simply moves the cursor into B's window, retaining views "C" and "B".
(The previous four commands are useful when comparing two buffers. Mnemonic – think of them as affecting the "A"lternate window.)
If for some reason you can't get your screen set right via a TERM variable, try the ":screen-rows" or ":screen-columns" commands (which take their args (number of rows or columns respectively) before you type the ":").
[ I put the following bindings in my startup file (.vilerc):
bind-key split-current-window ^T ; split into 'T'wo windows
bind-key next-window ^N ; 'N'ext window
bind-key previous-window ^P ; 'P'revious window
The usual ":e", ":r", ":f", ":w" commands are available, though only ":e!" and ":w!" are available of the "!" options. The command ":w >> filename" appends one file to another. The ":r" command reads the named file in after the current line. To read a file before the first line, use ":0r". File completion works like command completion: using the TAB and '?' keys you can complete or see next character choices. Additionally, on unix hosts, backquotes may be used to invoke a shell command that returns the path of a desired file. For example:
:e `which locks` ; csh looks for script called "locks"
:e `type -path locks` ; bash equivalent
The write-all-buffers command attempts to write all buffers whether marked "modified" or not.
As in vi, ranges of lines specified by line numbers (including '.', '$', and '%' shorthands) or marks may precede these commands. Unlike vi, search patterns cannot be used as line specifiers.
In addition, two non-"colon" commands have been added:
If a register is specified (e.g. "a^W ) then the command is _not_ an operator, but writes the specified register to the named file.
Anywhere a filename is valid, a command name is also valid, entered in the form "!shell-command". The whole line is handed to the shell, and the read or write operation is done on the commands standard input or output, as appropriate. Thus you can type ":e !date" to edit a copy of today's date.
The ": !cmd" shell escape works pretty much as it does in vi. The command ":!!" will rerun the previous such shell command.
The '!' operator works as a filter, as expected.
In addition, the ^X-! command runs a shell command and captures its output in a specific buffer, called "[Output]". This is almost identical to ":e !cmd", except that in that case the buffer is named according to the command name.
These "output capture" commands are most useful in conjunction with the "error finder", '^X-^X', described below.
Filename completion is performed on words of the shell command in response to a TAB character. To actually include a TAB character in the shell command, escape it with ^V. Command completion is not currently implemented – so, for instance, $PATH is not searched for possible completions to the first word of a command line.
On systems supporting job control, ^Z (or ":stop") will suspend vile.
The "set-environment-variable" (or "setenv") command can be used to export new or changed environment values to spawned programs. (Note that this might or might not affect the operation of vile features that are themselves controlled by environment variables, since those variables may only be checked once at the time that vile is started.)
The :cd and :pwd commands are of course supported. Unlike vi, filenames will track their directory of origin, so you can't simply edit a file in one directory, cd to another, and write it. You must explicitly write to ./filename in the new directory to accomplish this. ":cd -" will return to the previous directory, as it does in some shells. The CDPATH environment variable provides a search path for the :cd command. This variable's path delimiters are host-specific, as follows:
| Unix | colon |
| DOS, OS/2, Win32 | semicolon |
| VMS | comma |
Giving an argument to the ": !" (also called "shell-command" when writing macros) will suppress the "Press return to continue" message after the command runs.
Additional shell-related features are described in the section of this help file entitled "Working in a project hierarchy".
Remember, these are only the new or different commands. The standard vi set should still work.
The vi "global" (":g") command is present. So is the "substitute" (":s") command. These both look pretty different while they're being used than they do in vi, due to the interactive nature of the prompting. And, since the searching is done right after the pattern is entered, there may be a slight delay while you're trying to finish typing your complete command. (If the pattern does not exist, you may not get to finish typing your command at all.) You can use the commands just as you would have in vi, i.e. ":g/oldpat/s//newstring/" will work. But you won't see any of the '/' characters. Try it– you'll get the idea. Line ranges are not possible on ":g", but they are on ":s".
The ":g" command can be followed by any of l (list), p (print), < (left shift), > (right shift), r (read file), d (delete), L (lower case), U (upper case), ~ (flip case), put (append yanked text), Put (prepend yanked text), s (substitute), trim (trim trailing whitespace). For example, ":g/pattern/Put" will insert the contents of the default yank register just above every line containing "pattern". The ":g" command can only be used over the entire file – smaller regions are not permitted.
The ":v" counterpart to ":g" is also implemented – it performs the given command on all lines that don't match the given pattern.
The substitute command can be followed by any of 'g', a digit, or 'p', to do the substitution for all occurrences, the n'th occurrence, or to print the resulting line respectively. You can also add a 'c', and you will be asked to confirm each replacement before it occurs. The text being replaced will be highlighted, and you can answer with 'y', 'n', 'q', or 'a'. 'a' will suppress further prompting, and will do the rest of the replacements.
The ":&" and '&' commands work much as they do in vi, and repeat the last substitution. The '^A-&' command is a new operator (see below), so it can work on regions: for example use '^A-&}' to "repeat the previous substitution over the rest of this paragraph".
The named marks such as "'a" work as they do in vi. vile allows a decimal digit as a mark. It also recognizes special marks for the beginning and end of a selection: '< for the beginning and '> for the end (see the discussion of the quoted motion command).
vile also lets you undo all changes made to a buffer since it was first edited (so-called "infinite undo"). The '^X-u' command will undo changes, one by one (or given a count, several at a time). The '^X-r' command will walk forward, redoing the previously undone changes one by one. A fresh change to the buffer will cause previously undone changes to no longer be redoable. Remember that with key rebinding, you can change your 'u' or 'U' command to be an infinite undo, making it easier to type.
In addition, the '.' command, which normally re-executes the last buffer-modifying command, has special behavior with respect to undo. If the '.' command immediately follows one of the undo commands ('u', '^X-u', or '^X-r'), then it will perform another undo or redo, as appropriate. If there are any intervening commands, then '.' will re-execute the last command prior to the undo. [ This modification to the behavior of "u." does not conflict (much) with traditional use of '.', since by definition, the sequence "u." is (almost) always identical to "uu", and the latter is more easily typed. (Credit goes to the designers of "nvi" for this trick.) (BTW, the one case i know of where "u." is not identical to "uu" is when putting back the contents of the numbered registers: the sequence "1pu.u.u.u. would successively insert the contents of "1, "2, "3, "4, and "5, allowing you to choose the "correct" register. This sequence no longer works. You can still put them _all_ back with "1p..... ("1p for screen) and then delete the ones you _don't_ want. ]
The number of changes stored in the undo "history" is controlled by the numeric mode "undolimit". The default history length is 10 – that is, only 10 changes may be undone. Set the undolimit to 0 for truly infinite undo. This can consume a lot of memory. You can turn it completely off (and purge the undo stack) by setting noundoable.
The cursor position after an undo may not always be the same as it would be in vi.
Most operators affect the region exactly, but some cause only whole lines to be affected. This is usually a function of what sort of motion follows the operator, but can sometimes be affected by the operator itself. The best example of motions having different effects is the 'goto-mark' motions, the ''' and '`' commands. If a mark is set, say mark 'a', with the 'ma' command, then if the command d`a is executed, the exact text between the cursor and the mark will be deleted. If, on the other hand, the d'a command is used, the deleted region will include the lines containing the cursor and the mark in their entirety.
Some operators in vile can be "forced" to affect regions of whole lines, though the motion wouldn't normally imply it, by using the '^X' form of the command. (It's not really forced – it's really a separate operator.) For example, "d%" (assuming you are on a curly brace) will delete a C-style block of code. "^X-d%" will delete that same area, plus anything else on the lines containing the curly-brace endpoints.
Note that some operators always affect whole lines, no matter how the motion is specified. The '!' operator is an example: "!w" will always filter an entire line, and not just a single word.
vile extends this notion of the "shape" of a region by adding the concept of rectangular regions, whose boundaries are delimited by the rectangle whose opposite corners are at the cursor and at the other end of the motion, respectively. See the section "Rectangular regions" below.
The "show-operators" command will show all available operators. The "show-motions" command will show all available motions. Any operator may be followed by any motion.
There are several new operator commands in vile:
The following two commands may not always be present in vile, depending on how it was built:
vile supports vi-style "tags" files.
:ta is_sl<tab>
is completed as "is_slashc" . Pressing RETURN following completion opens a buffer on estruct.h, with the cursor positioned at the first definition of this tagname.
When one of these commands is used, vile will (by default) look for a file named "tags" in the current directory, and load it into a hidden buffer for use during tag searches. This buffer is editable if you wish (":e tags"), but will not appear in the buffer lists. If a buffer named "[Tags 1]" is already available when a tag is first requested, it will be used instead of a file found by searching the tags setting, and of course will remain visible.
Take note that the tag locate and pop commands, by default, move the cursor out of the current window if the target tag is located in one of the editor's other windows. To "pin" all locate and pop actions to the current window, set pin-tagstack mode.
The name of the default tags file may be changed with "set tags" (see "tags" under "Editor modes", below). If multiple filenames are given in the "tags" setting (separated by whitespace), they are searched in order, and placed in buffers named "[Tags 1]", "[Tags 2]", "[Tags 3]", etc.
Tags searched for using '^]' will always be matched exactly. If the ":ta" form of the command is used, tag matches will be exact unless the mode "taglength" is set non-zero, in which case the first tag matching that many characters will be used.
Filenames referred to in tags files are expanded, so environment variables and shell special characters like ~ may be used.
The stack of buffer locations waiting to be "popped" to with the '^T' (or '^X-^]' or ":pop") command may be viewed with the "show-tagstack" command. The "[Tag Stack]" buffer is animated – it will dynamically keep track of current tag references.
Limitations: In a real vi-style tags file, there are three tab separated fields. The first contains the tagname. The second contains the (relative or absolute) filename. Everything after the second tab is an arbitrary ex-mode command. vile is not quite so flexible as regular vi, and only supports a couple of commands in that last "field". It can be a line number, in which case the tag is an absolute index into the file. Or, it can be a search command. If it begins with a '/', the search goes forward. If it begins with a '?', the search goes backward. In either case, the matching delimiter _must_ be the last character on the line in the tags file.
All of this isn't as bad as it sounds, since ctags, the program most people use to generate tags files, does generate exactly this format. (Surprise, surprise.) However, if you attempt to create your own tags files, or have other tools that do so, you should be aware of these limitations.
For further tags usage examples, refer to the section of this help file entitled "Working in a project hierarchy".
The command parsing is done with regular expressions. Vile compiles these from the buffer [Error Expressions], which are a set of regular expressions with extra embedded information. Unescaped '%' followed by 'V', 'B', 'F', 'L', 'C' or 'T' substitute verb (Entering/Leaving for gmake), buffer (i.e., scratch buffer with a bracketed name), file, line, column and text fields.
The line and column numbers are 1-based, treating tab character as a single column. Use %l and %c, respectively for 0-based values.
The V, B, F, T substitutions are for nonblank fields, which is not always enough, so vile additionally recognizes a range in brackets, e.g.,
^%[^: ]:\s*%L:%T
is compiled as
^\([^: ]\+\):\s*\([0-9]\+\):\(.\+\)
; example of a macro to add to [Error Expressions]
store-procedure AddError
~local %oldbuffer
setv %oldbuffer=$cbufname
compile-error-expressions
yank-line
edit-file '[Error Expressions]'
unsetl view
goto-beginning-of-file
put-before
unmark
setl view
buffer %oldbuffer
compile-error-expressions
~endm
dq<arrow><arrow><arrow>...<arrow>qto delete all of the text between the starting point and the final cursor position.
Any motion command can appear in between the two 'q' commands. If used alone, i.e., not in an operator context, then the spanned text is highlighted, and yanked on completion (as well as setting the special named marks '< and '>) as a side effect. The resulting selection can then be manipulated with the ^S pseudo-motion, below. The selection-clear command removes the selection's highlight attributes.
Most motions will select up to but not including their endpoint. The 'e', 'E', 'f', 't', and '%' commands are exceptions to this. If used in an operator context the cursor position may sometimes appear incorrect. This is because operators sometimes change the cursor location internally to force the motion to do the "right" thing, and the 'q' command makes these internal "fudge factors" visible. An example of this is "dq%q" which does the right thing (assuming the cursor is on a '(' to start) but which looks wrong, since the cursor will overshoot the ')' before the second 'q' is typed.
If a mouse is available on a Unix host, whether in an xterm via the "xterm-mouse" setting, or in xvile, then button 1 can be clicked to do the extensions, since it, too, is a motion command. (Of course in xvile or winvile, it is easier to simply "click and drag" – the 'q' command isn't really necessary at all.)
Use the repeat-count to specify types of selection: exact=1 (default), full-line=2, rectangle=3.
^S makes it possible to select any region (including rectangular regions) of text with a mouse, and then apply any vi operator to that region.
| Technique | Applies To |
|---|---|
| selection-clear command | any host |
| left mouse button (LMB) click | winvile |
| click mode line with LMB | win32 host |
| press ESC | winvile |
Use a repeat count to show data for the wide locale. The default (no repeat count) shows the narrow locale. Use show-wide-printable to see wide characters past the first 256.
If showchar is set, this also shows a line for the current character in the current buffer, with the character type information for that character.
Use a repeat count to show the data for successive "pages" of 256 characters, e.g., 1 for 256-511, 2 for 512-767, etc.
This uses the same buffer as show-printable. If showchar is set, this also shows a line for the current character in the current buffer, with the character type information for that character.
In addition to the usual "a through "z, and "1 through "9, vile has additional registers.
The register named '<' contains the last few hundred keystrokes that have been typed by the user. The principle use for this is to make it easier to create :map commands based on commands you've already given. [It's also useful sometimes when debugging to be able to see what key sequence led to a problem...]
The register name '.' contains the current selected text in xvile. Also in xvile, the register name ';' is a synonym for the clipboard. Other versions of vile permit use of '.' and ';' as supplemental register storage.
The register name '"' (" is double-quote) is a synonym for the default unnamed register, which is also sometimes referred to as register 0.
Many responses to vile prompts need not be typed in their entirety. vile can complete the response for you. This applies to command names, file names, vile modes, vile variables, tags, buffers, and the "terminal characters".
To invoke vile completion, type a few characters and hit TAB (or your current "name-complete" terminal character). Hitting it a second time will pop up a window containing the list of possible completions. If there are more completions than will fit in the window, hitting further TAB characters will cause that window to scroll through the choices. The window will go away when the current command is finished.
An older form of completion is also supported:
You can also type a question mark (or the current "test-
completions" terminal character) to display a list of the
characters that you would have to type to complete the command.
For example, to complete the "unmark" or "unmap" commands:
:unm? – you type
:unm{a}[pr] – you see
This style of completion-display shows curly braces around the
string that will be supplied by pressing TAB, and square
brackets around characters that you must type to make the
command unique.
vile will understand your terminal's arrow keys, as long as they are described correctly in the termcap/terminfo database. The keys are interpreted as function keys, and are by default bound to the up, down, left, and right screen motions. These bindings are honored in insert mode as well as command mode.
Just as the regions defined by vi's commands and motions can either be "exact", or encompass "full lines", regions in vile can in addition be "rectangular". The easiest way to use a rectangular region is with the '\' motion, which, like '`' and ''', goes to a named mark. The region it describes, however, is "rectangular" (instead of "exact" or "full line"). The following operators know how to correctly act on rectangular regions:
Note that because it is sometimes hard to manipulate rectangles containing or bordering on tab characters, currently (for some operations) vile "detabs" the region being operated on before commencing, and re-entabs the lines again after the operation. The re-entabing is limited to leading whitespace, and of course is suppressed if "notabinsert" mode is set. [ This misfeature is arguably a bug, and may be fixed. In the meantime, you've been warned. ]
Modes come in various flavors and types and constitute the editor's primary configuration mechanism. vile supports these mode types:
boolean enum int string
The value of a mode is specified via "set" or "setl" (the latter command _only_ affects buffer modes, as described below). Mode values may be cleared with "unset" (or "unsetl" for buffer modes), as well as other idioms described later. Clearing a mode, by the way, is a fancy way of saying that its value is set to 0 or "", the latter for string types. When an enum mode is cleared, vile selects whichever enum constant is assigned the internal (read compiled) value of 0. Some concrete examples:
| Technique | Applies To | |
|---|---|---|
| mode type | mode name | example usage |
| boolean | autoindent | set autoindent |
| enum | visual-matches | set visual-matches=reverse |
| int | fillcol | set fillcol=75 |
| string | tags | set tags="../tags tags" |
To set/modify a universal mode, use the "set" command. Startup file examples:
set vtflash=normal unset flash ; or set noflash set errorbells
Since the set command (within a startup file) accepts multiple modes, this oneliner is equivalent:
set vtflash=normal noflash errorbells
To clear a universal mode use one of these idioms:
set no<modename> unset <modename> setno <modename>
For completeness sake, note that the "local" version of the set/unset commands ("setl"/"unsetl") do not make sense (and elicit no effect) when used with universal modes.
When vile is started, the global value of "view" mode is unset by default (i.e., false) and all newly visited buffers are editable. But suppose I edited the file "precious.cpp", which I did not want to modify. There are two approaches that could be taken:
$ vile
:set view ; enable view mode globally
:e precious.cpp ; edited in "view" mode
:e other.cpp ; ditto
or
$ vile
:e precious.cpp ; initially edited in "noview" mode
:setl view ; "view" mode now bound to precious.cpp
:e other.cpp ; edited in "noview" mode
In the first approach, view mode is enabled globally and consequently affects all existing buffers and all subsequently created buffers. This solution works for the stated goal, but makes it impossible to modify any other buffers. The second approach affects only the targeted file.
The animated buffers include:
[Binding List] [Buffer List] [Color Palette] [Color Schemes] [Command-Bindings] [Error Expressions] [Error Patterns] [Extra Colors] [Insert-Bindings] [Major Modes] [Map Sequences] [Map! Sequences] [Named Marks] [Printable Chars] [Registers] [Select-Bindings] [Settings] [Tag Stack] [Terminal Characters] [Variables]Turning off "animated" is rarely necessary: the capability is present mostly as a debugging aid. (B)
"auto" "none" (default) "utf-8" "le-assumed" "be-assumed" "utf-16le" "utf-16be" "utf-32le" "utf-32be"
The "auto" setting tells vile to set the buffer's byteorder-mark value based on whatever the file-encoding happens to be.
The default value is "none", which is slightly different, telling it to accept byteorder-mark values as in "auto", but not to write them for buffers which have no explicit byteorder mark set.
The "utf-XXX" values are explicit settings, which override the auto/none logic. Use "le-assumed" or "be-assumed" for cases where the platform's preferred byteorder is known, and where byteorder marks may be absent from files, e.g., with Windows. (B)
The percent-crlf mode tells vile how many lines in the buffer must have CR/LF endings for it to automatically treat a buffer in this manner.
On output, when writing a buffer with local dos mode set, all lines will be terminated with CR/LF pairs, rather than the usual single LF.
When buffers representing non-existent files are created they will inherit the line-style of the operating system (LF-only on UNIX and VMS, CRLF-style on DOS derivatives) regardless of the global setting of dos mode.
Setting dos mode makes editing binary files unreliable.
The global value for this mode is set on by default in DOS versions of vile, and should therefore be turned off if doing binary editing. (B)
"8bit" "ascii" "auto" "locale" (default) "utf-16" "utf-32" "utf-8"The "auto" setting tells vile to determine the encoding by inspecting the buffer contents. The "locale" setting tells vile to assume that the buffer contents are in the current locale's encoding. The "8bit" setting corresponds to the 8-bit locale support used since 9.3i (20021223). (B)
The choices are
On UNIX, glob can be set to be a pipe command that will expand more wildcards. The default value of glob on UNIX is "!echo %s", which should provide globbing that matches that of your shell. If set to a command that will separate filenames with newlines or nulls rather than spaces, then filenames containing spaces may be more easily edited. ("!/bin/ls -d %s" is one possibility, "!glob %s" is another if you use csh.) (U).
\<[[:ident:]]\+\>This is a buffer mode. (B)
"vi:" "vile:"or (depending on the configuration):
"xvile:" "winvile:"After that, either a "set" command terminated by a colon, e.g.,
vile:set txtmode:or one or more mode assignments, treating colons as a whitespace separator, e.g, these are equivalent,
vile:ts=4 nu vile:ts=4:nuThe modelines at the top of the buffer are processed first (working forward from the top), then the ones at the bottom (working backward from the end). If the buffer is small enough, the available modelines could overlap; but the program interprets each line at most once.
This is a buffer mode, enabling its use in majormodes. (B)
\<[[:file:]]\+\>This is a buffer mode. (B)
set-rs-cr set-rs-lf or set-unix-mode set-rs-crlf or set-dos-modeare aliases which set the corresponding local mode values of recordseparator. Set the recordseparator on a given buffer to control how it is written. (B)
<current buffer name> - <editor name>The swapped order is especially useful under limited screen real estate conditions. (U)
The '=' command can be used to clear this sort of highlighting, until the next search is done for a different pattern. Note that setting this mode can significantly slow down the editor's operation when complex or frequently occurring patterns are used, since vile will need to scan the entire buffer for matches on any change to the buffer. (B)
| Mode Value | Mode Semantics |
|---|---|
| off | feature disabled (default) |
| reverse | on err -> switch screen to normal then reverse video. |
| normal | on err -> switch screen to reverse then normal video. |
As is true with "flash" mode, no audible or visible indication will occur at all if "errorbells" mode is not set on. (U)
vile allows input, manipulation, and display of all 256 possible byte-wide characters. Wide characters are supported, depending on the device type and your locale settings.
If your locale (e.g., the LANG or LC_CTYPE environment variable on a POSIX platform) is configured properly, the "printing-low" and "printing-high" settings are not needed. vile initializes its character type tables based on the system. You can make finer adjustments to those tables as described in "Character Classes".
If your terminal (and locale) are set up to support UTF-8, vile can display files which use that encoding. It can also display UTF-16 and UTF-32 files using UTF-8. When the terminal/locale do not support UTF-8 vile displays the wide characters as hexadecimal codes, e.g., \u1234. Even when vile can display wide characters, you can force it to display the hexadecimal codes with the "unicode-as-hex" mode.
See UTF-8 Support versus Driver in config.doc for an overview of the terminal drivers.
If your terminal and locale are not set up to support UTF-8, vile displays UTF-8 codes that would map to Latin-1 (8-bit) values with a "\?" rather than "\x" prefix, to distinguish them from ordinary 8-bit values. It will also display this form for bytes found in UTF-8 files that cannot be decoded as UTF-8.
There are basically three ways of getting 8-bit characters into a vile buffer:
If you start vile in a locale that uses UTF-8 encoding, vile will check if there is a corresponding 8-bit encoding by stripping the UTF-8 suffix from the locale name, e.g., "en_US.UTF-8" to "en_US". When reading characters from the keyboard, it will map 8-bit codes to the 8-bit locale when editing a buffer whose file-encoding is "8bit" or "ascii".
Wide (Unicode) values can be entered in a similar fashion, though they are stored as more than one byte:
If the current buffer's "file-encoding" mode is set to one of the Unicode flavors (utf-8, utf-16 or utf-32), vile will display the value as a wide character. Otherwise it will show the bytes of the corresponding UTF-8 encoding.
Users who have no need to enter 8-bit text may want access to the meta-bound functions while in insert mode as well as command mode. The mode "meta-insert-bindings" controls whether functions bound to meta- keys (characters with the high bit set) are executed only in command mode, or in both command and insert modes. In either case, if a character is _not_ bound to a function, then it will be self-inserting when in insert mode. (To bind to a meta key in the .vilerc file, one may specify it as itself, or in hexadecimal or octal, or with the shorthand 'M-c' where c is the corresponding character without the high bit set.
(Although it is possible to edit and view all 256 characters, it is currently impossible to _search_ for a string that contains the NULL character, since this is used internally to terminate the search string.)
You may scroll through the list of previous replies to the :-prompt by using the up- or down-arrow special keys on your keyboard (if your configuration supports it).
Vile prompts for commands in parts, and stores a copy of the complete command in the [History] buffer. For example, you may type
:g/help/pand vile will prompt for the parts after each delimiter, e.g.,
global pattern: help action to perform on each matching line: pThe [History] buffer, shown with "show-history" will store
g/help/pAt each prompt, using the up/down arrows will tell vile to display the corresponding result for the "same" command. If [History] contains
g/take/g g/help/pthen the up/down arrows will show "take" or "help", skipping commands which do not begin with "g/".
The minibuffer (i.e., the last line on the screen, aka the :-prompt) can be edited using arrow keys, the delete character, or by toggling to vi-mode with the ^G (mini-edit) character. In mini-edit mode, you may use commands that do not move the cursor to a different line, as well as the following editing commands: i, a, I, A.
Vile treats the minibuffer specially. Completed lines are written to the history buffer. When scrolling up/down in the command history, vile displays the data that correspond to the command which you have entered, e.g., a :set command will display the variables entered for preceding :set commands.
As in vi, the % and # characters typed while responding to a prompt will expand to the current or "alternate" filename.
Also as in vi, the ~ character will expand to be the previous replacement pattern when entering either a replacement or search pattern,
In addition, the colon character (":") expands at most prompts to be the identifier name under the cursor.
Expansion of ! to the last command run is implemented, but only when a shell command is being entered.
Any of these expansions can be suppressed by prefixing with a '\'.
The "show-printable" command shows a table of the characters and their classes, e.g., printable, punctuation, etc.
You may modify the characters in (or corresponding to) the narrow local in this table by setting or unsetting a given class for a range of characters. The commands which do this are "set-char-class" and "delete-char-class" or "unset-char-class".
These commands expect the class name and a regular expression which defines a range of characters. The class names (short to allow "show-printable" to show everything in 80 columns) are
| Short | Long Description |
|---|---|
| arg | ex-style line range: 1,$ or 13,15 or % etc. |
| ctl | [:cntrl:] control character |
| del | delete/backspace |
| fn | fence character, e.g., "{" or "}" |
| id | [:ident:] normal identifier, used for word boundaries |
| lwr | [:lower:] lowercase, e.g., "a" |
| nsp | [:graph:] nonspace |
| num | [:digit:] digit, e.g., "0" |
| path | [:file:] file/path name |
| prn | [:print:] printable |
| pun | [:punct:] punctuation |
| qid | qualified identifiers, used in tags parsing |
| sh | may appear in shell/pipe |
| sp | [:blank:] space |
| tmp | legal in scratch-buffer names |
| upr | [:upper:] uppercase, e.g., "A" |
| wld | shell wildcard, e.g., "*" |
You can also reset the table to its initial state using "reset-char-classes".
There is a key rebinding facility (if vile is built to include it), which is invoked as follows. One must know the "english" name for the command being rebound. Use ":show-commands" or ":apropos string" to find english names containing "string". Then use the command:
:bind-key <englishname> <keyseq>
For configurations that permit it (X and win32, not termcap/terminfo), you may also specify a key modifier, i.e., "alt+", "ctrl+" or "shift+". The modifier follows the ^A or ^X prefix, e.g.,
shift+#6for shifted function-key 6.
Commands can also be bound to meta keys, which are regular ASCII characters with the eighth bit (0x80) bit set. The "printable" form for these keys is 'M-c'.
Commands bound to '#-c' or 'FN-c' key sequences are usually also available by using the function keys on the terminal. Thus the up-arrow function key can be bound to as '#-A' or 'FN-A'. Use show-key-names to see a complete list of these key sequences.
Even the ^A and ^X prefix characters can be rebound, using the dummy functions "cntl_a-prefix" and "cntl_x-prefix", and the '#' key itself can be rebound – it is represented by the command name "function-prefix".
Examples: To cause the / and ? commands to perform incremental searches, use:
bind-key incremental-search /
bind-key reverse-incremental-search ?
bind-key next-window ^N
bind-key previous-window ^P
bind-key next-page \s
(Space and tab can be represented with: "\s" and "\t".)
Note that when interactive, ^A and ^X are typed using the control key. In a file, however, they can be either a caret (^) followed by a letter, or the literal control key. In the latter case you would not use the '-' separator. So ^A-x as four distinct characters could also be entered as ^Ax, which would only be two characters.
Characters can be entered in hexadecimal or octal as well, in the form 0xNN, where NN is exactly two hexadecimal digits. If you know the hexadecimal value for a key, you can bind to it like:
bind-key next-window ^A-\x14
bind-key next-window #-\213
The sequence 'M-', represents a "meta-key", or a "meta" character. It is equivalent to setting the high bit of the following character, so 'M-e' is has the value of (0x80|0x65), or 0xe5.
Function and meta-key bindings are available in insert mode, as well as in command mode. (But only via either the "meta bit" or 'FN' sequence form – the '#' prefix will not work in insert mode.) There are four key binding tables:
bind-key describe-bindings describe-key unbind-key
bind-cmdmode-key describe-cmdmode-key show-cmdmode-bindings unbind-cmdmode-key
bind-insmode-key describe-insmode-bindings describe-insmode-key unbind-insmode-key
bind-selmode-key describe-selmode-bindings describe-selmode-key unbind-selmode-key
store-procedure begin-errtext
insert-string "fprintf(stderr, \""
set-named-mark z
insert-string "\\n\");\n"
goto-named-mark-exact z
; enter insert mode if we weren't already there
~if &seq $mode "command"
insert-chars
~endif
~endm
; bind to function key 5
bind-key begin-errtext FN-5
bind-insmode-key begin-errtext FN-5
; also bind to meta-A
bind-key begin-errtext M-A
bind-insmode-key begin-errtext M-A
^A- (three chars)
^X- (three chars)
^A (one char)
^X (one char)
#- (two chars) or
FN- (three chars)
M- (two chars)
(this is the same as with specifying a character
in that has the high bit set)
C (one char)
^C (one char)
^C (two chars)
\NNN (max of four chars, where NNN are octal digits)
\xNN (max of four chars, where NN are hex digits)
\n,\r,\t,\b,\f,\a (two chars each, usual meanings)
\e (two chars, means ESC)
\s (two chars, means SPACE)
(The "one char" control character entries in the above table are represented in this help file as two printable characters, to ensure they are not deleted by mailers or file transfer programs.)
The list of function key labels, along with their "vile name", are as follows:
| Usual Label | Vile name | Usual Label | Vile name |
|---|---|---|---|
| Up-arrow | #A | Home | #H |
| Down-arrow | #B | End | #E |
| Left-arrow | #D | Insert | #i |
| Right-arrow | #C | Delete | #d |
| Prior (PageUp) | #p | Find | #f |
| Next (PageDown) | #n | Select | #s |
| Help | #? | Menu | #m |
| F1 | #1 | F12 | #@ |
| F2 | #2 | F13 | ## |
| F3 | #3 | F14 | #$ |
| F4 | #4 | F15 | #% |
| F5 | #5 | F16 | #^ |
| F6 | #6 | F17 | #& |
| F7 | #7 | F18 | #* |
| F8 | #8 | F19 | #( |
| F9 | #9 | F20 | #) |
| F10 | #0 | F11 | #! |
| KeyPad_F1 | #P | KeyPad_F3 | #R |
| KeyPad_F2 | #Q | KeyPad_F4 | #S |
In addition, #M, #t, and #T are used internally to support mouse operations in an xterm. To undo the relationship between a "system-defined" function key and the poundsign sequence it produces, use ":unmap-system-chars".
Because "map" and "map!" may be used to remap arbitrary sequences, these sequences must be entered literally, i.e, the syntax for key sequences as listed above will not work for "map" and "map!". To enter control characters into a .vilerc file, use the ^V escaping mechanism. A map command entered from the command line will require fewer characters be escaped with ^V.
To provide a relatively portable way of specifying function key mappings, vile will reapply mapping to the result of a system- defined map. System function keys are mapped to "poundsign" sequences, like '#1' for function key 1, and '#B' for the down-arrow key. The remapping allows one to put
map #1 <some-user-map-sequence>
The "remap" option controls whether the successfully mapped result of a map is reevaluated for more mapping matches. The "noremap" (and "noremap!") variants of the map commands will force that particular mapping to be applied without subsequent remapping, regardless of the current setting of the global "remap" setting.
Since key sequences starting the '^X', '^A', or '#' prefixes are normally expected to act as a unit, no remapping is done on characters that follow such prefixes. For instance, this keeps a map like:
:map h ihello<ESC>
Long running loops caused by recursive :map definitions are detected and assumed to be infinite. When such a loop is detected, execution is aborted. Turning off the "remap" option, or doing some of the maps with the ":noremap/:noremap!" form of the map commands will eliminate most such loops.
vile normally duplicates real vi's behavior (but not vim's) in that the first character of the sequence being mapped to is not subject to recursive (map) evaluation. Assuming "remap" is on, pressing 'j' when ":map j jh" is in effect will not cause an infinite loop, whereas ":map j hj" _will_ cause such a loop. Setting the "remapfirst" option will allow this sort of remapping (and will cause an infinite loops for both examples).
The "maplonger" option controls whether the longer or shorter of two "nested" map strings will be favored by the editor. That is, if both "foo" and "foobar" are mapped (to presumably different values), then with "maplonger" set, vile will not expand "foo" until it is sure (either because the next character is not 'b', or a timeout has expired) that "foobar" will not be seen. Real vi will always expand "foo" immediately, and this is the default behavior. Though not particularly recommended, the "maplonger" mechanism even permits the following types of mappings:
:map z j
:map zz k
The left hand side of a map[!] definition may contain the usual backslash escapes: \n, \r, \t, \b, \f, \a (^G), \e (ESC), \s (SPACE), \xNN (hexadecimal), \NNN (octal). The right hand side is taken exactly literally, so special characters must be expressed as themselves.
The current set of mappings or "map!"ings may be viewed with the commands ":map<cr>" (or ":show-mapped-chars") or ":map!<cr>" (or ":show-mapped!-chars").
The system-defined maps, representing the function keys, may be shown with ":show-system-mapped-chars".
To undo a mapping, use "unmap", "unmap!", or "unmap-system-chars".
First, abbreviations are never expanded unless followed by non-"word" characters. In addition, abbreviations which begin like a "word" (i.e. with letters, digits, or the '_' character) are not expanded if they immediately follow another "word" character – they must follow whitespace or punctuation or the beginning of the line. Likewise, abbreviations that begin with a punctuation character are not detected within more punctuation – they must follow whitespace or a "word", or the beginning of the line.
If the "backspacelimit" setting is set (and it is, by default), then characters not inserted during the current insertion command are not considered in the above comparisons – the start of the current insertion behaves much like the beginning of line in that case.
Abbreviations are never recursive.
vile is more lenient than vi regarding what is a valid abbreviation. vi insists that an abbreviation be all "word" characters, or be all "non-word" characters, except for the last character, which _must_ be a "word" character. vile allows anything at all to be abbreviated, only enforcing the expansion rules mentioned above.
To undo an abbreviation, use "unabbreviate".
In addition to the above binding mechanism for vile commands, other keystrokes to the editor are rebindable using the "set-terminal" command. These keystrokes are mostly derived directly from the user's tty settings on entering the editor, but there are a couple of additions related to command and filename completion.
The values of these characters can be shown with the "show-terminal" command, and can be changed with the "set-terminal" command.
| Name | Default value | Typical value |
|---|---|---|
| backspace | from tty settings | (DEL or ^H) |
| interrupt | from tty settings | (^C or DEL) |
| line-kill | from tty settings | (^U or @) |
| mini-edit | (^G) | |
| name-complete | <tab> | |
| quote-next | from tty settings | (^V) |
| start-output | from tty settings | (^Q) |
| stop-output | from tty settings | (^S) |
| suspend | from tty settings | (^Z) |
| test-completions | ? | |
| word-kill | from tty settings | (^W) |
Historically, the flow of data between the computing host and the user's terminal was throttled through the use of special characters in the input stream, known as XON and XOFF (whose values are ^Q and ^S respectively). Most modern systems do not need these characters, and regulate the flow in an "out-of-band" manner. The terminal device driver, however, is usually still set up with software flow control enabled, to allow the user to manually start and stop output with the ^S and ^Q characters.
vile normally resets the driver to allow the ^S and ^Q characters to be bound to commands, since most systems no longer need software flow control, and since there is usually no reason for a user to wish to suspend output when running vile. Some older devices (usually older slower terminals), however, still need to be able to automatically control the data flow by generating ^S/^Q without the user's intervention.
To accommodate these situations, the "flow-control-enable" command will reset the terminal driver to its original state. Software flow-control will be re-enabled, and commands bound only to the ^S and ^Q characters will be inaccessible. The characters affected in this way may be seen with the "show-terminal-chars" command, where they will appear as the "start/stop-output" characters. The action of the "flow-control-enable" command will be reversed if it is given any argument.
The first type of macro in vile is for temporary, quick macro usage, and lets you record a set of keystrokes as you execute vile commands. You can then replay those keystrokes with a single key.
The vi '@' command is present as well, and can be used to execute the contents of a named register as if it were entered at the keyboard. To make this more useful, the "load-register" command will allow preloading a named register, from .vilerc file. For example:
use-register a load-register ihello^[
use-register w load-register ":!chmod +w %^M:w^M"
[ Note 1: the information presented in this section of the help file is a subset of "doc/macros.doc", which is supplied with the vile source code. macros.doc is the authoritative reference manual for the editor's macro language.
Note 2: the language features/directives described below are not limited solely to use within macros. These directives are often used within a startup/command file to configure the editor, load registers, etc. ]
vile can also be extended by defining macros and optionally binding the execution of those macros to key sequences. For instance, if the following lines appear in a .vilerc file:
1 store-macro
5 delete-til next-word
~endm
bind-key execute-macro-1 ^A-1
1 store-macro
5 delete-til lines
~endm
Macros come in two flavors: named and numbered. The syntax and advantages of each format are discussed next.
<number> store-macro
<language element>
...
<language element>
~endm
execute-macro-<number>
bind-key execute-macro-<number> <keystroke>
Note that numbered macros are allocated from a fixed pool (default is 40 macros). This fixed limit can be changed during the editor's configuration. Given their fixed allocation and the fact that their strictly numeric "names" don't facilitate easy recall, numbered macros are not used that much anymore.
store-procedure <unique-name>
<language element>
...
<language element>
~endm
A stored procedure is executed by simply referencing its name. To bind a keystroke to this macro, use this command:
bind-key <unique-name> <keystroke>
store-procedure write-msg-tst
write-message "this is a test macro"
~endm
bind-key write-msg-tst #h
:write-msg-tst
Note that named macros may also include parameters and a help string, each of which are described in doc/macros.doc.
store-operator fmt
$cmd-count filter-til $cmd-motion 'fmt -w50 -'
~endm
| Name | Description | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| $_ | most-recent macro $return value | ||||||||||||||||||||||||||||||||||||||||||||||
| $abufname | alternate buffer name (i.e. last visited) (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $autocolor-hook | name of the hook that runs when autocolor is enabled | ||||||||||||||||||||||||||||||||||||||||||||||
| $bchars | number of characters in current buffer (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $bchanged | true if current buffer is modified (boolean) | ||||||||||||||||||||||||||||||||||||||||||||||
| $bflags | status flags for current buffer (read only)
|
||||||||||||||||||||||||||||||||||||||||||||||
| $blines | number of lines in current buffer (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $brightness | RGB levels for gray, normal, bright in the 0-255 range (winvile version only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $buf-fname-expr | combined buffer+fname expression (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $buffer-hook | name of procedure to run when switching to a buffer | ||||||||||||||||||||||||||||||||||||||||||||||
| $bufname | current buffer-name under the cursor. | ||||||||||||||||||||||||||||||||||||||||||||||
| $bwindows | number of windows open on current buffer(read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $cbufname | current buffer name | ||||||||||||||||||||||||||||||||||||||||||||||
| $cdpath | editor's copy of the $CDPATH env var (read/write) | ||||||||||||||||||||||||||||||||||||||||||||||
| $cd-hook | name of procedure to run when changing directories | ||||||||||||||||||||||||||||||||||||||||||||||
| $cfgopts | comma-delimited list of "interesting" compiled options
(read only).
| ||||||||||||||||||||||||||||||||||||||||||||||
| $cfilname | current file name | ||||||||||||||||||||||||||||||||||||||||||||||
| $char | character under the cursor | ||||||||||||||||||||||||||||||||||||||||||||||
| $cmd-count | repeat-counter for the current macro (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $cmd-encoding | character set to use for minibuffer | ||||||||||||||||||||||||||||||||||||||||||||||
| $cmd-motion | motion for the current operator (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $cryptkey | encryption key (write only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $curchar | character offset in file | ||||||||||||||||||||||||||||||||||||||||||||||
| $curcol | current column position of cursor | ||||||||||||||||||||||||||||||||||||||||||||||
| $curline | current line in file | ||||||||||||||||||||||||||||||||||||||||||||||
| $cwd | current directory | ||||||||||||||||||||||||||||||||||||||||||||||
| $cwline | line offset in current window | ||||||||||||||||||||||||||||||||||||||||||||||
| $debug | macro debugging – set true for line by line tracing | ||||||||||||||||||||||||||||||||||||||||||||||
| $directory | controls location of temp-files (unused) | ||||||||||||||||||||||||||||||||||||||||||||||
| $discmd | display commands on command line (boolean) | ||||||||||||||||||||||||||||||||||||||||||||||
| $disinp | display command line input characters (boolean) | ||||||||||||||||||||||||||||||||||||||||||||||
| $encoding | character set associated with locale (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $end-of-cmd | true if user ended the cmd with <cr> | ||||||||||||||||||||||||||||||||||||||||||||||
| $error-buffer | buffer name assigned to the error-buffer | ||||||||||||||||||||||||||||||||||||||||||||||
| $error-expr | regular expression that matched the error-buffer | ||||||||||||||||||||||||||||||||||||||||||||||
| $error-match | text that matched the error-buffer | ||||||||||||||||||||||||||||||||||||||||||||||
| $error-tabstop | tabstop to use with error-buffer for %C | ||||||||||||||||||||||||||||||||||||||||||||||
| $exec-path | where to find vile (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $exec-suffix | suffix, if any, for execable programs (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $exit-hook | name of procedure to run when quitting | ||||||||||||||||||||||||||||||||||||||||||||||
| $favorites | path to favorites folder (win32 only) (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $fchanged | true if file for current buffer is modified (boolean) | ||||||||||||||||||||||||||||||||||||||||||||||
| $fence-limit | iteration limit for complex fences | ||||||||||||||||||||||||||||||||||||||||||||||
| $filename-expr | actual pattern for %F in [Error Expressions] | ||||||||||||||||||||||||||||||||||||||||||||||
| $filename-ic | ignore case in filename completion (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $filter-list | list of builtin-filters (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $findpath | editor's copy of the $VILE_FINDPATH env var (read/write) | ||||||||||||||||||||||||||||||||||||||||||||||
| $find-cmd | last spawned find command (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $font | current font name (X11/winvile versions only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $forward-search | search direction, true=forward | ||||||||||||||||||||||||||||||||||||||||||||||
| $helpfile | $VILE_HELP_FILE env var or "vile.hlp" (read/write) | ||||||||||||||||||||||||||||||||||||||||||||||
| $iconname | current icon name (X11 version only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $identifier | current "identifier-like" word under the cursor. | ||||||||||||||||||||||||||||||||||||||||||||||
| $kbd-macro | the keyboard macro, see ^X-( ^X-) (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $kill | some of the kill register (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $kill-limit | maximum length for $kill | ||||||||||||||||||||||||||||||||||||||||||||||
| $kill-size | length of the kill register (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $lastkey | last keyboard char struck | ||||||||||||||||||||||||||||||||||||||||||||||
| $latin1-expr | pattern to match locales using ISO-8859-1 in case they are not installed | ||||||||||||||||||||||||||||||||||||||||||||||
| $lcols | length of current line, in columns (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $libdir-path | appended to $PATH when running filters | ||||||||||||||||||||||||||||||||||||||||||||||
| $line | text of current line starting with cursor | ||||||||||||||||||||||||||||||||||||||||||||||
| $llength | length of current line (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $locale | locale, which determines character type (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $majormode | current majormode, if any (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $majormode-hook | procedure to overrride suffix/preamble rules | ||||||||||||||||||||||||||||||||||||||||||||||
| $match | last matched magic pattern (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $menu-file | the name of the menu file (e.g. .vilemenu) | ||||||||||||||||||||||||||||||||||||||||||||||
| $mode | current mode ("command","insert","overwrite") (rd. o.) | ||||||||||||||||||||||||||||||||||||||||||||||
| $modeline-format | format of mode lines. see "Mode line customization". | ||||||||||||||||||||||||||||||||||||||||||||||
| $modeline-limit | maximum inline offset to scan for mode lines | ||||||||||||||||||||||||||||||||||||||||||||||
| $modified | is current buffer modified or not? (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $ncolors | number of displayed colors, must be power of two | ||||||||||||||||||||||||||||||||||||||||||||||
| $ntildes | percent of window filled by ~ chars, at end of buffer | ||||||||||||||||||||||||||||||||||||||||||||||
| $ocwd | previous directory (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $os | "dos", "vms", "os/2", "win32", and "unix", although the latter may be replaced with a more specific name derived from vile's configure script. (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $pagelen | number of screen lines in use by editor | ||||||||||||||||||||||||||||||||||||||||||||||
| $pagewid | current screen width | ||||||||||||||||||||||||||||||||||||||||||||||
| $palette | current palette string | ||||||||||||||||||||||||||||||||||||||||||||||
| $patchlevel | current patch-level (empty for release) (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $pathlist-separator | separator for lists of pathnames, e.g., $PATH | ||||||||||||||||||||||||||||||||||||||||||||||
| $pathname | current "path-like" word, under the cursor. | ||||||||||||||||||||||||||||||||||||||||||||||
| $pathname-separator | separator for levels of pathnames, e.g., '/' | ||||||||||||||||||||||||||||||||||||||||||||||
| $pending | typeahead pending flag (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $pid | returns vile's process-id (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $position-format | format of ^G command. see "Mode line customization". | ||||||||||||||||||||||||||||||||||||||||||||||
| $progname | returns "vile" or "xvile" or "winvile". (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $prompt | the command-line prompt string ": " | ||||||||||||||||||||||||||||||||||||||||||||||
| $qidentifier | current qualified name (as with C++ ::) | ||||||||||||||||||||||||||||||||||||||||||||||
| $read-hook | name of procedure to run after a file is read | ||||||||||||||||||||||||||||||||||||||||||||||
| $replace | replacement pattern | ||||||||||||||||||||||||||||||||||||||||||||||
| $return | set within a macro to provide $_ on completion | ||||||||||||||||||||||||||||||||||||||||||||||
| $search | search pattern | ||||||||||||||||||||||||||||||||||||||||||||||
| $seed | current random number seed | ||||||||||||||||||||||||||||||||||||||||||||||
| $shell | name of the shell program for spawned commands. | ||||||||||||||||||||||||||||||||||||||||||||||
| $sres | current screen resolution | ||||||||||||||||||||||||||||||||||||||||||||||
| $startup-file | the name of the startup file (e.g. .vilerc) | ||||||||||||||||||||||||||||||||||||||||||||||
| $startup-path | where to find the startup file | ||||||||||||||||||||||||||||||||||||||||||||||
| $status | returns the status of the last command | ||||||||||||||||||||||||||||||||||||||||||||||
| $term-cols | number of columns in terminal window (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $term-encoding | terminal's encoding support (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $term-lines | number of lines in terminal window (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $term-resizes | true if vile handles terminal-resizing (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $title | current window title (X11, win32 versions only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $title-encoding | encoding of xterm window title, e.g., "8bit" for ISO-8859-1 or "utf-8". | ||||||||||||||||||||||||||||||||||||||||||||||
| $title-format | format of window title. see "Mode line customization". | ||||||||||||||||||||||||||||||||||||||||||||||
| $version | current version number (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $with-prefix | string set by "~with" directives (read only) | ||||||||||||||||||||||||||||||||||||||||||||||
| $wlines | number of lines in current window | ||||||||||||||||||||||||||||||||||||||||||||||
| $word | current "word" | ||||||||||||||||||||||||||||||||||||||||||||||
| $write-hook | name of procedure to run before a file is written | ||||||||||||||||||||||||||||||||||||||||||||||
| $xdisplay | the value to set $DISPLAY when running $xshell. | ||||||||||||||||||||||||||||||||||||||||||||||
| $xshell | name of the terminal program for spawned xvile commands. | ||||||||||||||||||||||||||||||||||||||||||||||
| $xshell-flags | command-line flags after $xshell, normally "-e" |
In addition to the state variables, you may set and use the values of the editor modes (i.e., universal modes, buffer-only modes or window-only modes), e.g., "setv $dos=true". The global values of the editor modes are not visible to the expression evaluator.
User-defined variables can also be set and used; their names are prefixed with the '%' character.
Response variables (a '@' followed by a prompt-string) cause vile to prompt for input with the given prompt-string.
Buffer variables (a '<' followed by a buffer name) return the current line of the specified buffer, automatically setting the position to the next line.
| Name | Args | Description |
|---|---|---|
| &abs | 1 | absolute value of a number |
| &add | 2 | add two numbers together |
| &and | 2 | logical and |
| &ascii | 1 | char to integer conversion |
| &bchanged | 1 | true if given buffer is modified |
| &bind | 1 | lookup what function name is bound to key |
| &cat | 2 | concatenate string |
| &cclass | 1 | character class (see "show-printable") |
| &chr | 1 | integer to char conversion |
| &classof | 1 | inverse of &isa, returns classes for param |
| &cmatch | 2 | caseless match regular-expression value |
| &date | 2 | format 2nd param with 1st, like strftime. |
| &default | 1 | initial/default value for mode or state variable |
| ÷ | 2 | division |
| &dquery | 2 | prompt user for input, given default value |
| &env | 1 | retrieve a system environment variable |
| &equal | 2 | numeric equality |
| &error | 1 | true if the parameter was ERROR |
| &execable | 1 | true if file is exec'able |
| &fchanged | 1 | true if file for given buffer is modified |
| &filter | 1 | true if the given majormode's filter is builtin |
| &ftime | 1 | modification-time of the given file, as a number |
| &geq | 2 | numeric greater than or equal |
| &global | 1 | retrieves global mode setting |
| &greater | 2 | numeric greater than |
| > | 2 | numeric greater than |
| >key | 0 | get 1 character |
| >motion | 1 | get keycode motion sequence for the binding |
| >sequence | 0 | get keycode sequence, e.g., #1 |
| &indirect | 1 | evaluate indirect value |
| &isa | 2 | check if the second param is a member of first |
| &left | 2 | left string(string, len) |
| &length | 1 | string length |
| &leq | 2 | numeric less than or equal |
| &lessthan | 2 | numeric less than |
| &local | 1 | retrieves local mode setting |
| &lookup | 2 | look for filename (see below for arguments) |
| &lower | 1 | lower case string |
| < | 2 | numeric less than |
| &match | 2 | match regular-expression value |
| &mclass | 1 | returns the mode's class, e.g., buffer or Major |
| &middle | 3 | mid string(string, pos, len) |
| &modulo | 2 | modulus |
| &negate | 1 | negate |
| &neq | 2 | numeric inequality |
| ¬ | 1 | logical not |
| &or | 2 | logical or |
| &path | 2 | extract/translate pathname (see below for args) |
| &pcat | 2 | concatenate directory and filename |
| &pquote | 1 | quote pathname if needed, e.g., embedded spaces |
| &qpasswd | 1 | prompt user for password string |
| &query | 1 | prompt user for input |
| &random | 1 | get a random number from 1 to n |
| &rd | 1 | is a file readable |
| &readable | 1 | is a file readable |
| ®ister | 1 | value of register (1-character name) |
| &right | 2 | right string(string, pos) |
| &rnd | 1 | get a random number from 1 to n |
| &sequal | 2 | string logical equality check |
| &sgeq | 2 | string greater than or equal |
| &sgreater | 2 | string logical greater than |
| &sgt | 2 | string greater than |
| &sindex | 2 | find the index of second string in first |
| &sleq | 2 | string less than or equal |
| &sless | 2 | string logical less than |
| &slt | 2 | string less than |
| &sneq | 2 | string inequality |
| &stime | 1 | system-time, as a number |
| &stoken | 3 | true if token found in string, given delims |
| &subtract | 2 | subtraction |
| × | 2 | multiplication |
| &token | 3 | select n'th token of string, given delims |
| &translate | 3 | translate "from" to "to" for given string. |
| &trim | 1 | trim whitespace from string |
| &upper | 1 | uppercase string |
| &word | 2 | select n'th word of string, blank-separated |
| &writable | 1 | is a file writable |
The &lookup function takes two arguments. The first is a keyword and the second is a filename. Keywords may be combined with '+', e.g., r+bin to find a readable file in the directory where vile's executable is. The keywords are for location:
| bin | look in vile's directory |
| current | look in the current directory |
| home | look in user's $HOME directory |
| libdir | look along $libdir-path |
| path | look along user's $PATH |
| startup | look along $startup-path |
| execable | test if file is exec'able |
| readable | test if file is readable |
| writable | test if file is writable |
The &path function takes two arguments. The first is a keyword and the second is a pathname. Keywords are: end (suffix of the filename), full (absolute path), head (directory), root (filename without suffix), short (relative path), tail (filename).
| Name | Description | |
|---|---|---|
~break | exit a ~while loop | |
~else | default conditional execution | |
~elseif cond | alternate conditional execution | |
~elsewith tokens | alterate tokens to following commands | |
~endif | finish conditional execution | |
~endm | finish a macro | |
~endwhile | finish a ~while loop | |
~endwith | finish a ~with block | |
~force | force macro to continue even if command fails | |
~goto label | jump to a label in the current macro | |
~hidden | do not update screen while the macro executes | |
~if cond | start conditional execution | |
~local vars | save specified variables, restore when macro terminates | |
~quiet | suppress messages while the macro executes | |
~return | terminate current macro | |
~trace cond | set $debug trace | |
~while cond | execute a loop if the condition is true | |
~with tokens | prepend tokens to following commands |
Line labels begin with a "*" as the first nonblank char, like:
*LBL01
~goto LBL01
In addition to the state variables, you may set and use the values of the editor modes (i.e., universal modes, buffer-only modes or window-only modes), e.g., "setv $dos=true". The global values of the editor modes are not visible to the expression evaluator.
User-defined variables can also be set and used; their names are prefixed with the '%' character.
Response variables (a '@' followed by a prompt-string) cause vile to prompt for input with the given prompt-string.
Buffer variables (a '<' followed by a buffer name) return the current line of the specified buffer, automatically setting the position to the next line.
| Name | Args | Description |
|---|---|---|
| &abs | 1 | absolute value of a number |
| &add | 2 | add two numbers together |
| &and | 2 | logical and |
| &ascii | 1 | char to integer conversion |
| &bchanged | 1 | true if given buffer is modified |
| &bind | 1 | lookup what function name is bound to key |
| &cat | 2 | concatenate string |
| &cclass | 1 | character class (see "show-printable") |
| &chr | 1 | integer to char conversion |
| &classof | 1 | inverse of &isa, returns classes for param |
| &cmatch | 2 | caseless match regular-expression value |
| &date | 2 | format 2nd param with 1st, like strftime. |
| &default | 1 | initial/default value for mode or state variable |
| ÷ | 2 | division |
| &dquery | 2 | prompt user for input, given default value |
| &env | 1 | retrieve a system environment variable |
| &equal | 2 | numeric equality |
| &error | 1 | true if the parameter was ERROR |
| &execable | 1 | true if file is exec'able |
| &fchanged | 1 | true if file for given buffer is modified |
| &filter | 1 | true if the given majormode's filter is builtin |
| &ftime | 1 | modification-time of the given file, as a number |
| &geq | 2 | numeric greater than or equal |
| &global | 1 | retrieves global mode setting |
| &greater | 2 | numeric greater than |
| > | 2 | numeric greater than |
| >key | 0 | get 1 character |
| >motion | 1 | get keycode motion sequence for the binding |
| >sequence | 0 | get keycode sequence, e.g., #1 |
| &indirect | 1 | evaluate indirect value |
| &isa | 2 | check if the second param is a member of first |
| &left | 2 | left string(string, len) |
| &length | 1 | string length |
| &leq | 2 | numeric less than or equal |
| &lessthan | 2 | numeric less than |
| &local | 1 | retrieves local mode setting |
| &lookup | 2 | look for filename (see below for arguments) |
| &lower | 1 | lower case string |
| < | 2 | numeric less than |
| &match | 2 | match regular-expression value |
| &mclass | 1 | returns the mode's class, e.g., buffer or Major |
| &middle | 3 | mid string(string, pos, len) |
| &modulo | 2 | modulus |
| &negate | 1 | negate |
| &neq | 2 | numeric inequality |
| ¬ | 1 | logical not |
| &or | 2 | logical or |
| &path | 2 | extract/translate pathname (see below for args) |
| &pcat | 2 | concatenate directory and filename |
| &pquote | 1 | quote pathname if needed, e.g., embedded spaces |
| &qpasswd | 1 | prompt user for password string |
| &query | 1 | prompt user for input |
| &random | 1 | get a random number from 1 to n |
| &rd | 1 | is a file readable |
| &readable | 1 | is a file readable |
| ®ister | 1 | value of register (1-character name) |
| &right | 2 | right string(string, pos) |
| &rnd | 1 | get a random number from 1 to n |
| &sequal | 2 | string logical equality check |
| &sgeq | 2 | string greater than or equal |
| &sgreater | 2 | string logical greater than |
| &sgt | 2 | string greater than |
| &sindex | 2 | find the index of second string in first |
| &sleq | 2 | string less than or equal |
| &sless | 2 | string logical less than |
| &slt | 2 | string less than |
| &sneq | 2 | string inequality |
| &stime | 1 | system-time, as a number |
| &stoken | 3 | true if token found in string, given delims |
| &subtract | 2 | subtraction |
| × | 2 | multiplication |
| &token | 3 | select n'th token of string, given delims |
| &translate | 3 | translate "from" to "to" for given string. |
| &trim | 1 | trim whitespace from string |
| &upper | 1 | uppercase string |
| &word | 2 | select n'th word of string, blank-separated |
| &writable | 1 | is a file writable |
The &lookup function takes two arguments. The first is a keyword and the second is a filename. Keywords may be combined with '+', e.g., r+bin to find a readable file in the directory where vile's executable is. The keywords are for location:
| bin | look in vile's directory |
| current | look in the current directory |
| home | look in user's $HOME directory |
| libdir | look along $libdir-path |
| path | look along user's $PATH |
| startup | look along $startup-path |
| execable | test if file is exec'able |
| readable | test if file is readable |
| writable | test if file is writable |
The &path function takes two arguments. The first is a keyword and the second is a pathname. Keywords are: end (suffix of the filename), full (absolute path), head (directory), root (filename without suffix), short (relative path), tail (filename).
| Name | Description | |
|---|---|---|
~break | exit a ~while loop | |
~else | default conditional execution | |
~elseif cond | alternate conditional execution | |
~elsewith tokens | alterate tokens to following commands | |
~endif | finish conditional execution | |
~endm | finish a macro | |
~endwhile | finish a ~while loop | |
~endwith | finish a ~with block | |
~force | force macro to continue even if command fails | |
~goto label | jump to a label in the current macro | |
~hidden | do not update screen while the macro executes | |
~if cond | start conditional execution | |
~local vars | save specified variables, restore when macro terminates | |
~quiet | suppress messages while the macro executes | |
~return | terminate current macro | |
~trace cond | set $debug trace | |
~while cond | execute a loop if the condition is true | |
~with tokens | prepend tokens to following commands |
Line labels begin with a "*" as the first nonblank char, like:
*LBL01
~goto LBL01
In addition to the state variables, you may set and use the values of the editor modes (i.e., universal modes, buffer-only modes or window-only modes), e.g., "setv $dos=true". The global values of the editor modes are not visible to the expression evaluator.
User-defined variables can also be set and used; their names are prefixed with the '%' character.
Response variables (a '@' followed by a prompt-string) cause vile to prompt for input with the given prompt-string.
Buffer variables (a '<' followed by a buffer name) return the current line of the specified buffer, automatically setting the position to the next line.
| Name | Args | Description |
|---|---|---|
| &abs | 1 | absolute value of a number |
| &add | 2 | add two numbers together |
| &and | 2 | logical and |
| &ascii | 1 | char to integer conversion |
| &bchanged | 1 | true if given buffer is modified |
| &bind | 1 | lookup what function name is bound to key |
| &cat | 2 | concatenate string |
| &cclass | 1 | character class (see "show-printable") |
| &chr | 1 | integer to char conversion |
| &classof | 1 | inverse of &isa, returns classes for param |
| &cmatch | 2 | caseless match regular-expression value |
| &date | 2 | format 2nd param with 1st, like strftime. |
| &default | 1 | initial/default value for mode or state variable |
| ÷ | 2 | division |
| &dquery | 2 | prompt user for input, given default value |
| &env | 1 | retrieve a system environment variable |
| &equal | 2 | numeric equality |
| &error | 1 | true if the parameter was ERROR |
| &execable | 1 | true if file is exec'able |
| &fchanged | 1 | true if file for given buffer is modified |
| &filter | 1 | true if the given majormode's filter is builtin |
| &ftime | 1 | modification-time of the given file, as a number |
| &geq | 2 | numeric greater than or equal |
| &global | 1 | retrieves global mode setting |
| &greater | 2 | numeric greater than |
| > | 2 | numeric greater than |
| >key | 0 | get 1 character |
| >motion | 1 | get keycode motion sequence for the binding |
| >sequence | 0 | get keycode sequence, e.g., #1 |
| &indirect | 1 | evaluate indirect value |
| &isa | 2 | check if the second param is a member of first |
| &left | 2 | left string(string, len) |
| &length | 1 | string length |
| &leq | 2 | numeric less than or equal |
| &lessthan | 2 | numeric less than |
| &local | 1 | retrieves local mode setting |
| &lookup | 2 | look for filename (see below for arguments) |
| &lower | 1 | lower case string |
| < | 2 | numeric less than |
| &match | 2 | match regular-expression value |
| &mclass | 1 | returns the mode's class, e.g., buffer or Major |
| &middle | 3 | mid string(string, pos, len) |
| &modulo | 2 | modulus |
| &negate | 1 | negate |
| &neq | 2 | numeric inequality |
| ¬ | 1 | logical not |
| &or | 2 | logical or |
| &path | 2 | extract/translate pathname (see below for args) |
| &pcat | 2 | concatenate directory and filename |
| &pquote | 1 | quote pathname if needed, e.g., embedded spaces |
| &qpasswd | 1 | prompt user for password string |
| &query | 1 | prompt user for input |
| &random | 1 | get a random number from 1 to n |
| &rd | 1 | is a file readable |
| &readable | 1 | is a file readable |
| ®ister | 1 | value of register (1-character name) |
| &right | 2 | right string(string, pos) |
| &rnd | 1 | get a random number from 1 to n |
| &sequal | 2 | string logical equality check |
| &sgeq | 2 | string greater than or equal |
| &sgreater | 2 | string logical greater than |
| &sgt | 2 | string greater than |
| &sindex | 2 | find the index of second string in first |
| &sleq | 2 | string less than or equal |
| &sless | 2 | string logical less than |
| &slt | 2 | string less than |
| &sneq | 2 | string inequality |
| &stime | 1 | system-time, as a number |
| &stoken | 3 | true if token found in string, given delims |
| &subtract | 2 | subtraction |
| × | 2 | multiplication |
| &token | 3 | select n'th token of string, given delims |
| &translate | 3 | translate "from" to "to" for given string. |
| &trim | 1 | trim whitespace from string |
| &upper | 1 | uppercase string |
| &word | 2 | select n'th word of string, blank-separated |
| &writable | 1 | is a file writable |
The &lookup function takes two arguments. The first is a keyword and the second is a filename. Keywords may be combined with '+', e.g., r+bin to find a readable file in the directory where vile's executable is. The keywords are for location:
| bin | look in vile's directory |
| current | look in the current directory |
| home | look in user's $HOME directory |
| libdir | look along $libdir-path |
| path | look along user's $PATH |
| startup | look along $startup-path |
| execable | test if file is exec'able |
| readable | test if file is readable |
| writable | test if file is writable |
The &path function takes two arguments. The first is a keyword and the second is a pathname. Keywords are: end (suffix of the filename), full (absolute path), head (directory), root (filename without suffix), short (relative path), tail (filename).
| Name | Description | |
|---|---|---|
~break | exit a ~while loop | |
~else | default conditional execution | |
~elseif cond | alternate conditional execution | |
~elsewith tokens | alterate tokens to following commands | |
~endif | finish conditional execution | |
~endm | finish a macro | |
~endwhile | finish a ~while loop | |
~endwith | finish a ~with block | |
~force | force macro to continue even if command fails | |
~goto label | jump to a label in the current macro | |
~hidden | do not update screen while the macro executes | |
~if cond | start conditional execution | |
~local vars | save specified variables, restore when macro terminates | |
~quiet | suppress messages while the macro executes | |
~return | terminate current macro | |
~trace cond | set $debug trace | |
~while cond | execute a loop if the condition is true | |
~with tokens | prepend tokens to following commands |
Line labels begin with a "*" as the first nonblank char, like:
*LBL01
~goto LBL01
In addition to the state variables, you may set and use the values of the editor modes (i.e., universal modes, buffer-only modes or window-only modes), e.g., "setv $dos=true". The global values of the editor modes are not visible to the expression evaluator.
User-defined variables can also be set and used; their names are prefixed with the '%' character.
Response variables (a '@' followed by a prompt-string) cause vile to prompt for input with the given prompt-string.
Buffer variables (a '<' followed by a buffer name) return the current line of the specified buffer, automatically setting the position to the next line.
| Name | Args | Description |
|---|---|---|
| &abs | 1 | absolute value of a number |
| &add | 2 | add two numbers together |
| &and | 2 | logical and |
| &ascii | 1 | char to integer conversion |
| &bchanged | 1 | true if given buffer is modified |
| &bind | 1 | lookup what function name is bound to key |
| &cat | 2 | concatenate string |
| &cclass | 1 | character class (see "show-printable") |
| &chr | 1 | integer to char conversion |
| &classof | 1 | inverse of &isa, returns classes for param |
| &cmatch | 2 | caseless match regular-expression value |
| &date | 2 | format 2nd param with 1st, like strftime. |
| &default | 1 | initial/default value for mode or state variable |
| ÷ | 2 | division |
| &dquery | 2 | prompt user for input, given default value |
| &env | 1 | retrieve a system environment variable |
| &equal | 2 | numeric equality |
| &error | 1 | true if the parameter was ERROR |
| &execable | 1 | true if file is exec'able |
| &fchanged | 1 | true if file for given buffer is modified |
| &filter | 1 | true if the given majormode's filter is builtin |
| &ftime | 1 | modification-time of the given file, as a number |
| &geq | 2 | numeric greater than or equal |
| &global | 1 | retrieves global mode setting |
| &greater | 2 | numeric greater than |
| > | 2 | numeric greater than |
| >key | 0 | get 1 character |
| >motion | 1 | get keycode motion sequence for the binding |
| >sequence | 0 | get keycode sequence, e.g., #1 |
| &indirect | 1 | evaluate indirect value |
| &isa | 2 | check if the second param is a member of first |
| &left | 2 | left string(string, len) |
| &length | 1 | string length |
| &leq | 2 | numeric less than or equal |
| &lessthan | 2 | numeric less than |
| &local | 1 | retrieves local mode setting |
| &lookup | 2 | look for filename (see below for arguments) |
| &lower | 1 | lower case string |
| < | 2 | numeric less than |
| &match | 2 | match regular-expression value |
| &mclass | 1 | returns the mode's class, e.g., buffer or Major |
| &middle | 3 | mid string(string, pos, len) |
| &modulo | 2 | modulus |
| &negate | 1 | negate |
| &neq | 2 | numeric inequality |
| ¬ | 1 | logical not |
| &or | 2 | logical or |
| &path | 2 | extract/translate pathname (see below for args) |
| &pcat | 2 | concatenate directory and filename |
| &pquote | 1 | quote pathname if needed, e.g., embedded spaces |
| &qpasswd | 1 | prompt user for password string |
| &query | 1 | prompt user for input |
| &random | 1 | get a random number from 1 to n |
| &rd | 1 | is a file readable |
| &readable | 1 | is a file readable |
| ®ister | 1 | value of register (1-character name) |
| &right | 2 | right string(string, pos) |
| &rnd | 1 | get a random number from 1 to n |
| &sequal | 2 | string logical equality check |
| &sgeq | 2 | string greater than or equal |
| &sgreater | 2 | string logical greater than |
| &sgt | 2 | string greater than |
| &sindex | 2 | find the index of second string in first |
| &sleq | 2 | string less than or equal |
| &sless | 2 | string logical less than |
| &slt | 2 | string less than |
| &sneq | 2 | string inequality |
| &stime | 1 | system-time, as a number |
| &stoken | 3 | true if token found in string, given delims |
| &subtract | 2 | subtraction |
| × | 2 | multiplication |
| &token | 3 | select n'th token of string, given delims |
| &translate | 3 | translate "from" to "to" for given string. |
| &trim | 1 | trim whitespace from string |
| &upper | 1 | uppercase string |
| &word | 2 | select n'th word of string, blank-separated |
| &writable | 1 | is a file writable |
The &lookup function takes two arguments. The first is a keyword and the second is a filename. Keywords may be combined with '+', e.g., r+bin to find a readable file in the directory where vile's executable is. The keywords are for location:
| bin | look in vile's directory |
| current | look in the current directory |
| home | look in user's $HOME directory |
| libdir | look along $libdir-path |
| path | look along user's $PATH |
| startup | look along $startup-path |
| execable | test if file is exec'able |
| readable | test if file is readable |
| writable | test if file is writable |
The &path function takes two arguments. The first is a keyword and the second is a pathname. Keywords are: end (suffix of the filename), full (absolute path), head (directory), root (filename without suffix), short (relative path), tail (filename).
| Name | Description | |
|---|---|---|
~break | exit a ~while loop | |
~else | default conditional execution | |
~elseif cond | alternate conditional execution | |
~elsewith tokens | alterate tokens to following commands | |
~endif | finish conditional execution | |
~endm | finish a macro | |
~endwhile | finish a ~while loop | |
~endwith | finish a ~with block | |
~force | force macro to continue even if command fails | |
~goto label | jump to a label in the current macro | |
~hidden | do not update screen while the macro executes | |
~if cond | start conditional execution | |
~local vars | save specified variables, restore when macro terminates | |
~quiet | suppress messages while the macro executes | |
~return | terminate current macro | |
~trace cond | set $debug trace | |
~while cond | execute a loop if the condition is true | |
~with tokens | prepend tokens to following commands |
Line labels begin with a "*" as the first nonblank char, like:
*LBL01
~goto LBL01
In addition to the state variables, you may set and use the values of the editor modes (i.e., universal modes, buffer-only modes or window-only modes), e.g., "setv $dos=true". The global values of the editor modes are not visible to the expression evaluator.
User-defined variables can also be set and used; their names are prefixed with the '%' character.
Response variables (a '@' followed by a prompt-string) cause vile to prompt for input with the given prompt-string.
Buffer variables (a '<' followed by a buffer name) return the current line of the specified buffer, automatically setting the position to the next line.
| Name | Args | Description |
|---|---|---|
| &abs | 1 | absolute value of a number |
| &add | 2 | add two numbers together |
| &and | 2 | logical and |
| &ascii | 1 | char to integer conversion |
| &bchanged | 1 | true if given buffer is modified |
| &bind | 1 | lookup what function name is bound to key |
| &cat | 2 | concatenate string |
| &cclass | 1 | character class (see "show-printable") |
| &chr | 1 | integer to char conversion |
| &classof | 1 | inverse of &isa, returns classes for param |
| &cmatch | 2 | caseless match regular-expression value |
| &date | 2 | format 2nd param with 1st, like strftime. |
| &default | 1 | initial/default value for mode or state variable |
| ÷ | 2 | division |
| &dquery | 2 | prompt user for input, given default value |
| &env | 1 | retrieve a system environment variable |
| &equal | 2 | numeric equality |
| &error | 1 | true if the parameter was ERROR |
| &execable | 1 | true if file is exec'able |
| &fchanged | 1 | true if file for given buffer is modified |
| &filter | 1 | true if the given majormode's filter is builtin |
| &ftime | 1 | modification-time of the given file, as a number |
| &geq | 2 | numeric greater than or equal |
| &global | 1 | retrieves global mode setting |
| &greater | 2 | numeric greater than |
| > | 2 | numeric greater than |
| >key | 0 | get 1 character |
| >motion | 1 | get keycode motion sequence for the binding |
| >sequence | 0 | get keycode sequence, e.g., #1 |
| &indirect | 1 | evaluate indirect value |
| &isa | 2 | check if the second param is a member of first |
| &left | 2 | left string(string, len) |
| &length | 1 | string length |
| &leq | 2 | numeric less than or equal |
| &lessthan | 2 | numeric less than |
| &local | 1 | retrieves local mode setting |
| &lookup | 2 | look for filename (see below for arguments) |
| &lower | 1 | lower case string |
| < | 2 | numeric less than |
| &match | 2 | match regular-expression value |
| &mclass | 1 | returns the mode's class, e.g., buffer or Major |
| &middle | 3 | mid string(string, pos, len) |
| &modulo | 2 | modulus |
| &negate | 1 | negate |
| &neq | 2 | numeric inequality |
| ¬ | 1 | logical not |
| &or | 2 | logical or |
| &path | 2 | extract/translate pathname (see below for args) |
| &pcat | 2 | concatenate directory and filename |
| &pquote | 1 | quote pathname if needed, e.g., embedded spaces |
| &qpasswd | 1 | prompt user for password string |
| &query | 1 | prompt user for input |
| &random | 1 | get a random number from 1 to n |
| &rd | 1 | is a file readable |
| &readable | 1 | is a file readable |
| ®ister | 1 | value of register (1-character name) |
| &right | 2 | right string(string, pos) |
| &rnd | 1 | get a random number from 1 to n |
| &sequal | 2 | string logical equality check |
| &sgeq | 2 | string greater than or equal |
| &sgreater | 2 | string logical greater than |
| &sgt | 2 | string greater than |
| &sindex | 2 | find the index of second string in first |
| &sleq | 2 | string less than or equal |
| &sless | 2 | string logical less than |
| &slt | 2 | string less than |
| &sneq | 2 | string inequality |
| &stime | 1 | system-time, as a number |
| &stoken | 3 | true if token found in string, given delims |
| &subtract | 2 | subtraction |
| × | 2 | multiplication |
| &token | 3 | select n'th token of string, given delims |
| &translate | 3 | translate "from" to "to" for given string. |
| &trim | 1 | trim whitespace from string |
| &upper | 1 | uppercase string |
| &word | 2 | select n'th word of string, blank-separated |
| &writable | 1 | is a file writable |
The &lookup function takes two arguments. The first is a keyword and the second is a filename. Keywords may be combined with '+', e.g., r+bin to find a readable file in the directory where vile's executable is. The keywords are for location:
| bin | look in vile's directory |
| current | look in the current directory |
| home | look in user's $HOME directory |
| libdir | look along $libdir-path |
| path | look along user's $PATH |
| startup | look along $startup-path |
| execable | test if file is exec'able |
| readable | test if file is readable |
| writable | test if file is writable |
The &path function takes two arguments. The first is a keyword and the second is a pathname. Keywords are: end (suffix of the filename), full (absolute path), head (directory), root (filename without suffix), short (relative path), tail (filename).
| Name | Description | |
|---|---|---|
~break | exit a ~while loop | |
~else | default conditional execution | |
~elseif cond | alternate conditional execution | |
~elsewith tokens | alterate tokens to following commands | |
~endif | finish conditional execution | |
~endm | finish a macro | |
~endwhile | finish a ~while loop | |
~endwith | finish a ~with block | |
~force | force macro to continue even if command fails | |
~goto label | jump to a label in the current macro | |
~hidden | do not update screen while the macro executes | |
~if cond | start conditional execution | |
~local vars | save specified variables, restore when macro terminates | |
~quiet | suppress messages while the macro executes | |
~return | terminate current macro | |
~trace cond | set $debug trace | |
~while cond | execute a loop if the condition is true | |
~with tokens | prepend tokens to following commands |
Line labels begin with a "*" as the first nonblank char, like:
*LBL01
~goto LBL01
In addition to the state variables, you may set and use the values of the editor modes (i.e., universal modes, buffer-only modes or window-only modes), e.g., "setv $dos=true". The global values of the editor modes are not visible to the expression evaluator.
User-defined variables can also be set and used; their names are prefixed with the '%' character.
Response variables (a '@' followed by a prompt-string) cause vile to prompt for input with the given prompt-string.
Buffer variables (a '<' followed by a buffer name) return the current line of the specified buffer, automatically setting the position to the next line.
| Name | Args | Description |
|---|---|---|
| &abs | 1 | absolute value of a number |
| &add | 2 | add two numbers together |
| &and | 2 | logical and |
| &ascii | 1 | char to integer conversion |
| &bchanged | 1 | true if given buffer is modified |
| &bind | 1 | lookup what function name is bound to key |
| &cat | 2 | concatenate string |
| &cclass | 1 | character class (see "show-printable") |
| &chr | 1 | integer to char conversion |
| &classof | 1 | inverse of &isa, returns classes for param |
| &cmatch | 2 | caseless match regular-expression value |
| &date | 2 | format 2nd param with 1st, like strftime. |
| &default | 1 | initial/default value for mode or state variable |
| ÷ | 2 | division |
| &dquery | 2 | prompt user for input, given default value |
| &env | 1 | retrieve a system environment variable |
| &equal | 2 | numeric equality |
| &error | 1 | true if the parameter was ERROR |
| &execable | 1 | true if file is exec'able |
| &fchanged | 1 | true if file for given buffer is modified |
| &filter | 1 | true if the given majormode's filter is builtin |
| &ftime | 1 | modification-time of the given file, as a number |
| &geq | 2 | numeric greater than or equal |
| &global | 1 | retrieves global mode setting |
| &greater | 2 | numeric greater than |
| > | 2 | numeric greater than |
| >key | 0 | get 1 character |
| >motion | 1 | get keycode motion sequence for the binding |
| >sequence | 0 | get keycode sequence, e.g., #1 |
| &indirect | 1 | evaluate indirect value |
| &isa | 2 | check if the second param is a member of first |
| &left | 2 | left string(string, len) |
| &length | 1 | string length |
| &leq | 2 | numeric less than or equal |
| &lessthan | 2 | numeric less than |
| &local | 1 | retrieves local mode setting |
| &lookup | 2 | look for filename (see below for arguments) |
| &lower | 1 | lower case string |
| < | 2 | numeric less than |
| &match | 2 | match regular-expression value |
| &mclass | 1 | returns the mode's class, e.g., buffer or Major |
| &middle | 3 | mid string(string, pos, len) |
| &modulo | 2 | modulus |
| &negate | 1 | negate |
| &neq | 2 | numeric inequality |
| ¬ | 1 | logical not |
| &or | 2 | logical or |
| &path | 2 | extract/translate pathname (see below for args) |
| &pcat | 2 | concatenate directory and filename |
| &pquote | 1 | quote pathname if needed, e.g., embedded spaces |
| &qpasswd | 1 | prompt user for password string |
| &query | 1 | prompt user for input |
| &random | 1 | get a random number from 1 to n |
| &rd | 1 | is a file readable |
| &readable | 1 | is a file readable |
| ®ister | 1 | value of register (1-character name) |
| &right | 2 | right string(string, pos) |
| &rnd | 1 | get a random number from 1 to n |
| &sequal | 2 | string logical equality check |
| &sgeq | 2 | string greater than or equal |
| &sgreater | 2 | string logical greater than |
| &sgt | 2 | string greater than |
| &sindex | 2 | find the index of second string in first |
| &sleq | 2 | string less than or equal |
| &sless | 2 | string logical less than |
| &slt | 2 | string less than |
| &sneq | 2 | string inequality |
| &stime | 1 | system-time, as a number |
| &stoken | 3 | true if token found in string, given delims |
| &subtract | 2 | subtraction |
| × | 2 | multiplication |
| &token | 3 | select n'th token of string, given delims |
| &translate | 3 | translate "from" to "to" for given string. |
| &trim | 1 | trim whitespace from string |
| &upper | 1 | uppercase string |
| &word | 2 | select n'th word of string, blank-separated |
| &writable | 1 | is a file writable |
The &lookup function takes two arguments. The first is a keyword and the second is a filename. Keywords may be combined with '+', e.g., r+bin to find a readable file in the directory where vile's executable is. The keywords are for location:
| bin | look in vile's directory |
| current | look in the current directory |
| home | look in user's $HOME directory |
| libdir | look along $libdir-path |
| path | look along user's $PATH |
| startup | look along $startup-path |
| execable | test if file is exec'able |
| readable | test if file is readable |
| writable | test if file is writable |
The &path function takes two arguments. The first is a keyword and the second is a pathname. Keywords are: end (suffix of the filename), full (absolute path), head (directory), root (filename without suffix), short (relative path), tail (filename).
| Name | Description | |
|---|---|---|
~break | exit a ~while loop | |
~else | default conditional execution | |
~elseif cond | alternate conditional execution | |
~elsewith tokens | alterate tokens to following commands | |
~endif | finish conditional execution | |
~endm | finish a macro | |
~endwhile | finish a ~while loop | |
~endwith | finish a ~with block | |
~force | force macro to continue even if command fails | |
~goto label | jump to a label in the current macro | |
~hidden | do not update screen while the macro executes | |
~if cond | start conditional execution | |
~local vars | save specified variables, restore when macro terminates | |
~quiet | suppress messages while the macro executes | |
~return | terminate current macro | |
~trace cond | set $debug trace | |
~while cond | execute a loop if the condition is true | |
~with tokens | prepend tokens to following commands |
Line labels begin with a "*" as the first nonblank char, like:
*LBL01
~goto LBL01
In addition to the state variables, you may set and use the values of the editor modes (i.e., universal modes, buffer-only modes or window-only modes), e.g., "setv $dos=true". The global values of the editor modes are not visible to the expression evaluator.
User-defined variables can also be set and used; their names are prefixed with the '%' character.
Response variables (a '@' followed by a prompt-string) cause vile to prompt for input with the given prompt-string.
Buffer variables (a '<' followed by a buffer name) return the current line of the specified buffer, automatically setting the position to the next line.
| Name | Args | Description |
|---|---|---|
| &abs | 1 | absolute value of a number |
| &add | 2 | add two numbers together |
| &and | 2 | logical and |
| &ascii | 1 | char to integer conversion |
| &bchanged | 1 | true if given buffer is modified |
| &bind | 1 | lookup what function name is bound to key |
| &cat | 2 | concatenate string |
| &cclass | 1 | character class (see "show-printable") |
| &chr | 1 | integer to char conversion |
| &classof | 1 | inverse of &isa, returns classes for param |
| &cmatch | 2 | caseless match regular-expression value |
| &date | 2 | format 2nd param with 1st, like strftime. |
| &default | 1 | initial/default value for mode or state variable |
| ÷ | 2 | division |
| &dquery | 2 | prompt user for input, given default value |
| &env | 1 | retrieve a system environment variable |
| &equal | 2 | numeric equality |
| &error | 1 | true if the parameter was ERROR |
| &execable | 1 | true if file is exec'able |
| &fchanged | 1 | true if file for given buffer is modified |
| &filter | 1 | true if the given majormode's filter is builtin |
| &ftime | 1 | modification-time of the given file, as a number |
| &geq | 2 | numeric greater than or equal |
| &global | 1 | retrieves global mode setting |
| &greater | 2 | numeric greater than |
| > | 2 | numeric greater than |
| >key | 0 | get 1 character |
| >motion | 1 | get keycode motion sequence for the binding |
| >sequence | 0 | get keycode sequence, e.g., #1 |
| &indirect | 1 | evaluate indirect value |
| &isa | 2 | check if the second param is a member of first |
| &left | 2 | left string(string, len) |
| &length | 1 | string length |
| &leq | 2 | numeric less than or equal |
| &lessthan | 2 | numeric less than |
| &local | 1 | retrieves local mode setting |
| &lookup | 2 | look for filename (see below for arguments) |
| &lower | 1 | lower case string |
| < | 2 | numeric less than |
| &match | 2 | match regular-expression value |
| &mclass | 1 | returns the mode's class, e.g., buffer or Major |
| &middle | 3 | mid string(string, pos, len) |
| &modulo | 2 | modulus |
| &negate | 1 | negate |
| &neq | 2 | numeric inequality |
| ¬ | 1 | logical not |
| &or | 2 | logical or |
| &path | 2 | extract/translate pathname (see below for args) |
| &pcat | 2 | concatenate directory and filename |
| &pquote | 1 | quote pathname if needed, e.g., embedded spaces |
| &qpasswd | 1 | prompt user for password string |
| &query | 1 | prompt user for input |
| &random | 1 | get a random number from 1 to n |
| &rd | 1 | is a file readable |
| &readable | 1 | is a file readable |
| ®ister | 1 | value of register (1-character name) |
| &right | 2 | right string(string, pos) |
| &rnd | 1 | get a random number from 1 to n |
| &sequal | 2 | string logical equality check |
| &sgeq | 2 | string greater than or equal |
| &sgreater | 2 | string logical greater than |
| &sgt | 2 | string greater than |
| &sindex | 2 | find the index of second string in first |
| &sleq | 2 | string less than or equal |
| &sless | 2 | string logical less than |
| &slt | 2 | string less than |
| &sneq | 2 | string inequality |
| &stime | 1 | system-time, as a number |
| &stoken | 3 | true if token found in string, given delims |
| &subtract | 2 | subtraction |
| × | 2 | multiplication |
| &token | 3 | select n'th token of string, given delims |
| &translate | 3 | translate "from" to "to" for given string. |
| &trim | 1 | trim whitespace from string |
| &upper | 1 | uppercase string |
| &word | 2 | select n'th word of string, blank-separated |
| &writable | 1 | is a file writable |
The &lookup function takes two arguments. The first is a keyword and the second is a filename. Keywords may be combined with '+', e.g., r+bin to find a readable file in the directory where vile's executable is. The keywords are for location:
| bin | look in vile's directory |
| current | look in the current directory |
| home | look in user's $HOME directory |
| libdir | look along $libdir-path |
| path | look along user's $PATH |
| startup | look along $startup-path |
| execable | test if file is exec'able |
| readable | test if file is readable |
| writable | test if file is writable |
The &path function takes two arguments. The first is a keyword and the second is a pathname. Keywords are: end (suffix of the filename), full (absolute path), head (directory), root (filename without suffix), short (relative path), tail (filename).
| Name | Description | |
|---|---|---|
~break | exit a ~while loop | |
~else | default conditional execution | |
~elseif cond | alternate conditional execution | |
~elsewith tokens | alterate tokens to following commands | |
~endif | finish conditional execution | |
~endm | finish a macro | |
~endwhile | finish a ~while loop | |
~endwith | finish a ~with block | |
~force | force macro to continue even if command fails | |
~goto label | jump to a label in the current macro | |
~hidden | do not update screen while the macro executes | |
~if cond | start conditional execution | |
~local vars | save specified variables, restore when macro terminates | |
~quiet | suppress messages while the macro executes | |
~return | terminate current macro | |
~trace cond | set $debug trace | |
~while cond | execute a loop if the condition is true | |
~with tokens | prepend tokens to following commands |
Line labels begin with a "*" as the first nonblank char, like:
*LBL01
~goto LBL01
In addition to the state variables, you may set and use the values of the editor modes (i.e., universal modes, buffer-only modes or window-only modes), e.g., "setv $dos=true". The global values of the editor modes are not visible to the expression evaluator.
User-defined variables can also be set and used; their names are prefixed with the '%' character.
Response variables (a '@' followed by a prompt-string) cause vile to prompt for input with the given prompt-string.
Buffer variables (a '<' followed by a buffer name) return the current line of the specified buffer, automatically setting the position to the next line.
| Name | Args | Description |
|---|---|---|
| &abs | 1 | absolute value of a number |
| &add | 2 | add two numbers together |
| &and | 2 | logical and |
| &ascii | 1 | char to integer conversion |
| &bchanged | 1 | true if given buffer is modified |
| &bind | 1 | lookup what function name is bound to key |
| &cat | 2 | concatenate string |
| &cclass | 1 | character class (see "show-printable") |
| &chr | 1 | integer to char conversion |
| &classof | 1 | inverse of &isa, returns classes for param |
| &cmatch | 2 | caseless match regular-expression value |
| &date | 2 | format 2nd param with 1st, like strftime. |
| &default | 1 | initial/default value for mode or state variable |
| ÷ | 2 | division |
| &dquery | 2 | prompt user for input, given default value |
| &env | 1 | retrieve a system environment variable |
| &equal | 2 | numeric equality |
| &error | 1 | true if the parameter was ERROR |
| &execable | 1 | true if file is exec'able |
| &fchanged | 1 | true if file for given buffer is modified |
| &filter | 1 | true if the given majormode's filter is builtin |
| &ftime | 1 | modification-time of the given file, as a number |
| &geq | 2 | numeric greater than or equal |
| &global | 1 | retrieves global mode setting |
| &greater | 2 | numeric greater than |
| > | 2 | numeric greater than |
| >key | 0 | get 1 character |
| >motion | 1 | get keycode motion sequence for the binding |
| >sequence | 0 | get keycode sequence, e.g., #1 |
| &indirect | 1 | evaluate indirect value |
| &isa | 2 | check if the second param is a member of first |
| &left | 2 | left string(string, len) |
| &length | 1 | string length |
| &leq | 2 | numeric less than or equal |
| &lessthan | 2 | numeric less than |
| &local | 1 | retrieves local mode setting |
| &lookup | 2 | look for filename (see below for arguments) |
| &lower | 1 | lower case string |
| < | 2 | numeric less than |
| &match | 2 | match regular-expression value |
| &mclass | 1 | returns the mode's class, e.g., buffer or Major |
| &middle | 3 | mid string(string, pos, len) |
| &modulo | 2 | modulus |
| &negate | 1 | negate |
| &neq | 2 | numeric inequality |
| ¬ | 1 | logical not |
| &or | 2 | logical or |
| &path | 2 | extract/translate pathname (see below for args) |
| &pcat | 2 | concatenate directory and filename |
| &pquote | 1 | quote pathname if needed, e.g., embedded spaces |
| &qpasswd | 1 | prompt user for password string |
| &query | 1 | prompt user for input |
| &random | 1 | get a random number from 1 to n |
| &rd | 1 | is a file readable |
| &readable | 1 | is a file readable |
| ®ister | 1 | value of register (1-character name) |
| &right | 2 | right string(string, pos) |
| &rnd | 1 | get a random number from 1 to n |
| &sequal | 2 | string logical equality check |
| &sgeq | 2 | string greater than or equal |
| &sgreater | 2 | string logical greater than |
| &sgt | 2 | string greater than |
| &sindex | 2 | find the index of second string in first |
| &sleq | 2 | string less than or equal |
| &sless | 2 | string logical less than |
| &slt | 2 | string less than |
| &sneq | 2 | string inequality |
| &stime | 1 | system-time, as a number |
| &stoken | 3 | true if token found in string, given delims |
| &subtract | 2 | subtraction |
| × | 2 | multiplication |
| &token | 3 | select n'th token of string, given delims |
| &translate | 3 | translate "from" to "to" for given string. |
| &trim | 1 | trim whitespace from string |
| &upper | 1 | uppercase string |
| &word | 2 | select n'th word of string, blank-separated |
| &writable | 1 | is a file writable |
The &lookup function takes two arguments. The first is a keyword and the second is a filename. Keywords may be combined with '+', e.g., r+bin to find a readable file in the directory where vile's executable is. The keywords are for location:
| bin | look in vile's directory |
| current | look in the current directory |
| home | look in user's $HOME directory |
| libdir | look along $libdir-path |
| path | look along user's $PATH |
| startup | look along $startup-path |
| execable | test if file is exec'able |
| readable | test if file is readable |
| writable | test if file is writable |
The &path function takes two arguments. The first is a keyword and the second is a pathname. Keywords are: end (suffix of the filename), full (absolute path), head (directory), root (filename without suffix), short (relative path), tail (filename).
| Name | Description | |
|---|---|---|
~break | exit a ~while loop | |
~else | default conditional execution | |
~elseif cond | alternate conditional execution | |
~elsewith tokens | alterate tokens to following commands | |
~endif | finish conditional execution | |
~endm | finish a macro | |
~endwhile | finish a ~while loop | |
~endwith | finish a ~with block | |
~force | force macro to continue even if command fails | |
~goto label | jump to a label in the current macro | |
~hidden | do not update screen while the macro executes | |
~if cond | start conditional execution | |
~local vars | save specified variables, restore when macro terminates | |
~quiet | suppress messages while the macro executes | |
~return | terminate current macro | |
~trace cond | set $debug trace | |
~while cond | execute a loop if the condition is true | |
~with tokens | prepend tokens to following commands |
Line labels begin with a "*" as the first nonblank char, like:
*LBL01
~goto LBL01
In addition to the state variables, you may set and use the values of the editor modes (i.e., universal modes, buffer-only modes or window-only modes), e.g., "setv $dos=true". The global values of the editor modes are not visible to the expression evaluator.
User-defined variables can also be set and used; their names are prefixed with the '%' character.
Response variables (a '@' followed by a prompt-string) cause vile to prompt for input with the given prompt-string.
Buffer variables (a '<' followed by a buffer name) return the current line of the specified buffer, automatically setting the position to the next line.
| Name | Args | Description |
|---|---|---|
| &abs | 1 | absolute value of a number |
| &add | 2 | add two numbers together |
| &and | 2 | logical and |
| &ascii | 1 | char to integer conversion |
| &bchanged | 1 | true if given buffer is modified |
| &bind | 1 | lookup what function name is bound to key |
| &cat | 2 | concatenate string |
| &cclass | 1 | character class (see "show-printable") |
| &chr | 1 | integer to char conversion |
| &classof | 1 | inverse of &isa, returns classes for param |
| &cmatch | 2 | caseless match regular-expression value |
| &date | 2 | format 2nd param with 1st, like strftime. |
| &default | 1 | initial/default value for mode or state variable |
| ÷ | 2 | division |
| &dquery | 2 | prompt user for input, given default value |
| &env | 1 | retrieve a system environment variable |
| &equal | 2 | numeric equality |
| &error | 1 | true if the parameter was ERROR |
| &execable | 1 | true if file is exec'able |
| &fchanged | 1 | true if file for given buffer is modified |
| &filter | 1 | true if the given majormode's filter is builtin |
| &ftime | 1 | modification-time of the given file, as a number |
| &geq | 2 | numeric greater than or equal |
| &global | 1 | retrieves global mode setting |
| &greater | 2 | numeric greater than |
| > | 2 | numeric greater than |
| >key | 0 | get 1 character |
| >motion | 1 | get keycode motion sequence for the binding |
| >sequence | 0 | get keycode sequence, e.g., #1 |
| &indirect | 1 | evaluate indirect value |
| &isa | 2 | check if the second param is a member of first |
| &left | 2 | left string(string, len) |
| &length | 1 | string length |
| &leq | 2 | numeric less than or equal |
| &lessthan | 2 | numeric less than |
| &local | 1 | retrieves local mode setting |
| &lookup | 2 | look for filename (see below for arguments) |
| &lower | 1 | lower case string |
| < | 2 | numeric less than |
| &match | 2 | match regular-expression value |
| &mclass | 1 | returns the mode's class, e.g., buffer or Major |
| &middle | 3 | mid string(string, pos, len) |
| &modulo | 2 | modulus |
| &negate | 1 | negate |
| &neq | 2 | numeric inequality |
| ¬ | 1 | logical not |
| &or | 2 | logical or |
| &path | 2 | extract/translate pathname (see below for args) |
| &pcat | 2 | concatenate directory and filename |
| &pquote | 1 | quote pathname if needed, e.g., embedded spaces |
| &qpasswd | 1 | prompt user for password string |
| &query | 1 | prompt user for input |
| &random | 1 | get a random number from 1 to n |
| &rd | 1 | is a file readable |
| &readable | 1 | is a file readable |
| ®ister | 1 | value of register (1-character name) |
| &right | 2 | right string(string, pos) |
| &rnd | 1 | get a random number from 1 to n |
| &sequal | 2 | string logical equality check |
| &sgeq | 2 | string greater than or equal |
| &sgreater | 2 | string logical greater than |
| &sgt | 2 | string greater than |
| &sindex | 2 | find the index of second string in first |
| &sleq | 2 | string less than or equal |
| &sless | 2 | string logical less than |
| &slt | 2 | string less than |
| &sneq | 2 | string inequality |
| &stime | 1 | system-time, as a number |
| &stoken | 3 | true if token found in string, given delims |
| &subtract | 2 | subtraction |
| × | 2 | multiplication |
| &token | 3 | select n'th token of string, given delims |
| &translate | 3 | translate "from" to "to" for given string. |
| &trim | 1 | trim whitespace from string |
| &upper | 1 | uppercase string |
| &word | 2 | select n'th word of string, blank-separated |
| &writable | 1 | is a file writable |
The &lookup function takes two arguments. The first is a keyword and the second is a filename. Keywords may be combined with '+', e.g., r+bin to find a readable file in the directory where vile's executable is. The keywords are for location:
| bin | look in vile's directory |
| current | look in the current directory |
| home | look in user's $HOME directory |
| libdir | look along $libdir-path |
| path | look along user's $PATH |
| startup | look along $startup-path |
| execable | test if file is exec'able |
| readable | test if file is readable |
| writable | test if file is writable |
The &path function takes two arguments. The first is a keyword and the second is a pathname. Keywords are: end (suffix of the filename), full (absolute path), head (directory), root (filename without suffix), short (relative path), tail (filename).
| Name | Description | |
|---|---|---|
~break | exit a ~while loop | |
~else | default conditional execution | |
~elseif cond | alternate conditional execution | |
~elsewith tokens | alterate tokens to following commands | |
~endif | finish conditional execution | |
~endm | finish a macro | |
~endwhile | finish a ~while loop | |
~endwith | finish a ~with block | |
~force | force macro to continue even if command fails | |
~goto label | jump to a label in the current macro | |
~hidden | do not update screen while the macro executes | |
~if cond | start conditional execution | |
~local vars | save specified variables, restore when macro terminates | |
~quiet | suppress messages while the macro executes | |
~return | terminate current macro | |
~trace cond | set $debug trace | |
~while cond | execute a loop if the condition is true | |
~with tokens | prepend tokens to following commands |
Line labels begin with a "*" as the first nonblank char, like:
*LBL01
~goto LBL01
In addition to the state variables, you may set and use the values of the editor modes (i.e., universal modes, buffer-only modes or window-only modes), e.g., "setv $dos=true". The global values of the editor modes are not visible to the expression evaluator.
User-defined variables can also be set and used; their names are prefixed with the '%' character.
Response variables (a '@' followed by a prompt-string) cause vile to prompt for input with the given prompt-string.
Buffer variables (a '<' followed by a buffer name) return the current line of the specified buffer, automatically setting the position to the next line.
| Name | Args | Description |
|---|---|---|
| &abs | 1 | absolute value of a number |
| &add | 2 | add two numbers together |
| &and | 2 | logical and |
| &ascii | 1 | char to integer conversion |
| &bchanged | 1 | true if given buffer is modified |
| &bind | 1 | lookup what function name is bound to key |
| &cat | 2 | concatenate string |
| &cclass | 1 | character class (see "show-printable") |
| &chr | 1 | integer to char conversion |
| &classof | 1 | inverse of &isa, returns classes for param |
| &cmatch | 2 | caseless match regular-expression value |
| &date | 2 | format 2nd param with 1st, like strftime. |
| &default | 1 | initial/default value for mode or state variable |
| ÷ | 2 | division |
| &dquery | 2 | prompt user for input, given default value |
| &env | 1 | retrieve a system environment variable |
| &equal | 2 | numeric equality |
| &error | 1 | true if the parameter was ERROR |
| &execable | 1 | true if file is exec'able |
| &fchanged | 1 | true if file for given buffer is modified |
| &filter | 1 | true if the given majormode's filter is builtin |
| &ftime | 1 | modification-time of the given file, as a number |
| &geq | 2 | numeric greater than or equal |
| &global | 1 | retrieves global mode setting |
| &greater | 2 | numeric greater than |
| > | 2 | numeric greater than |
| >key | 0 | get 1 character |
| >motion | 1 | get keycode motion sequence for the binding |
| >sequence | 0 | get keycode sequence, e.g., #1 |
| &indirect | 1 | evaluate indirect value |
| &isa | 2 | check if the second param is a member of first |
| &left | 2 | left string(string, len) |
| &length | 1 | string length |
| &leq | 2 | numeric less than or equal |
| &lessthan | 2 | numeric less than |
| &local | 1 | retrieves local mode setting |
| &lookup | 2 | look for filename (see below for arguments) |
| &lower | 1 | lower case string |
| < | 2 | numeric less than |
| &match | 2 | match regular-expression value |
| &mclass | 1 | returns the mode's class, e.g., buffer or Major |
| &middle | 3 | mid string(string, pos, len) |
| &modulo | 2 | modulus |
| &negate | 1 | negate |
| &neq | 2 | numeric inequality |
| ¬ | 1 | logical not |
| &or | 2 | logical or |
| &path | 2 | extract/translate pathname (see below for args) |
| &pcat | 2 | concatenate directory and filename |
| &pquote | 1 | quote pathname if needed, e.g., embedded spaces |
| &qpasswd | 1 | prompt user for password string |
| &query | 1 | prompt user for input |
| &random | 1 | get a random number from 1 to n |
| &rd | 1 | is a file readable |
| &readable | 1 | is a file readable |
| ®ister | 1 | value of register (1-character name) |
| &right | 2 | right string(string, pos) |
| &rnd | 1 | get a random number from 1 to n |
| &sequal | 2 | string logical equality check |
| &sgeq | 2 | string greater than or equal |
| &sgreater | 2 | string logical greater than |
| &sgt | 2 | string greater than |
| &sindex | 2 | find the index of second string in first |
| &sleq | 2 | string less than or equal |
| &sless | 2 | string logical less than |
| &slt | 2 | string less than |
| &sneq | 2 | string inequality |
| &stime | 1 | system-time, as a number |
| &stoken | 3 | true if token found in string, given delims |
| &subtract | 2 | subtraction |
| × | 2 | multiplication |
| &token | 3 | select n'th token of string, given delims |
| &translate | 3 | translate "from" to "to" for given string. |
| &trim | 1 | trim whitespace from string |
| &upper | 1 | uppercase string |
| &word | 2 | select n'th word of string, blank-separated |
| &writable | 1 | is a file writable |
The &lookup function takes two arguments. The first is a keyword and the second is a filename. Keywords may be combined with '+', e.g., r+bin to find a readable file in the directory where vile's executable is. The keywords are for location:
| bin | look in vile's directory |
| current | look in the current directory |
| home | look in user's $HOME directory |
| libdir | look along $libdir-path |
| path | look along user's $PATH |
| startup | look along $startup-path |
| execable | test if file is exec'able |
| readable | test if file is readable |
| writable | test if file is writable |
The &path function takes two arguments. The first is a keyword and the second is a pathname. Keywords are: end (suffix of the filename), full (absolute path), head (directory), root (filename without suffix), short (relative path), tail (filename).
| Name | Description | |
|---|---|---|
~break | exit a ~while loop | |
~else | default conditional execution | |
~elseif cond | alternate conditional execution | |
~elsewith tokens | alterate tokens to following commands | |
~endif | finish conditional execution | |
~endm | finish a macro | |
~endwhile | finish a ~while loop | |
~endwith | finish a ~with block | |
~force | force macro to continue even if command fails | |
~goto label | jump to a label in the current macro | |
~hidden | do not update screen while the macro executes | |
~if cond | start conditional execution | |
~local vars | save specified variables, restore when macro terminates | |
~quiet | suppress messages while the macro executes | |
~return | terminate current macro | |
~trace cond | set $debug trace | |
~while cond | execute a loop if the condition is true | |
~with tokens | prepend tokens to following commands |
Line labels begin with a "*" as the first nonblank char, like:
*LBL01
~goto LBL01
In addition to the state variables, you may set and use the values of the editor modes (i.e., universal modes, buffer-only modes or window-only modes), e.g., "setv $dos=true". The global values of the editor modes are not visible to the expression evaluator.
User-defined variables can also be set and used; their names are prefixed with the '%' character.
Response variables (a '@' followed by a prompt-string) cause vile to prompt for input with the given prompt-string.
Buffer variables (a '<' followed by a buffer name) return the current line of the specified buffer, automatically setting the position to the next line.
| Name | Args | Description |
|---|---|---|
| &abs | 1 | absolute value of a number |
| &add | 2 | add two numbers together |
| &and | 2 | logical and |
| &ascii | 1 | char to integer conversion |
| &bchanged | 1 | true if given buffer is modified |
| &bind | 1 | lookup what function name is bound to key |
| &cat | 2 | concatenate string |
| &cclass | 1 | character class (see "show-printable") |
| &chr | 1 | integer to char conversion |
| &classof | 1 | inverse of &isa, returns classes for param |
| &cmatch | 2 | caseless match regular-expression value |
| &date | 2 | format 2nd param with 1st, like strftime. |
| &default | 1 | initial/default value for mode or state variable |
| ÷ | 2 | division |
| &dquery | 2 | prompt user for input, given default value |
| &env | 1 | retrieve a system environment variable |
| &equal | 2 | numeric equality |
| &error | 1 | true if the parameter was ERROR |
| &execable | 1 | true if file is exec'able |
| &fchanged | 1 | true if file for given buffer is modified |
| &filter | 1 | true if the given majormode's filter is builtin |
| &ftime | 1 | modification-time of the given file, as a number |
| &geq | 2 | numeric greater than or equal |
| &global | 1 | retrieves global mode setting |
| &greater | 2 | numeric greater than |
| > | 2 | numeric greater than |
| >key | 0 | get 1 character |
| >motion | 1 | get keycode motion sequence for the binding |
| >sequence | 0 | get keycode sequence, e.g., #1 |
| &indirect | 1 | evaluate indirect value |
| &isa | 2 | check if the second param is a member of first |
| &left | 2 | left string(string, len) |
| &length | 1 | string length |
| &leq | 2 | numeric less than or equal |
| &lessthan | 2 | numeric less than |
| &local | 1 | retrieves local mode setting |
| &lookup | 2 | look for filename (see below for arguments) |
| &lower | 1 | lower case string |
| < | 2 | numeric less than |
| &match | 2 | match regular-expression value |
| &mclass | 1 | returns the mode's class, e.g., buffer or Major |
| &middle | 3 | mid string(string, pos, len) |
| &modulo | 2 | modulus |
| &negate | 1 | negate |
| &neq | 2 | numeric inequality |
| ¬ | 1 | logical not |
| &or | 2 | logical or |
| &path | 2 | extract/translate pathname (see below for args) |
| &pcat | 2 | concatenate directory and filename |
| &pquote | 1 | quote pathname if needed, e.g., embedded spaces |
| &qpasswd | 1 | prompt user for password string |
| &query | 1 | prompt user for input |
| &random | 1 | get a random number from 1 to n |
| &rd | 1 | is a file readable |
| &readable | 1 | is a file readable |
| ®ister | 1 | value of register (1-character name) |
| &right | 2 | right string(string, pos) |
| &rnd | 1 | get a random number from 1 to n |
| &sequal | 2 | string logical equality check |
| &sgeq | 2 | string greater than or equal |
| &sgreater | 2 | string logical greater than |
| &sgt | 2 | string greater than |
| &sindex | 2 | find the index of second string in first |
| &sleq | 2 | string less than or equal |
| &sless | 2 | string logical less than |
| &slt | 2 | string less than |
| &sneq | 2 | string inequality |
| &stime | 1 | system-time, as a number |
| &stoken | 3 | true if token found in string, given delims |
| &subtract | 2 | subtraction |
| × | 2 | multiplication |
| &token | 3 | select n'th token of string, given delims |
| &translate | 3 | translate "from" to "to" for given string. |
| &trim | 1 | trim whitespace from string |
| &upper | 1 | uppercase string |
| &word | 2 | select n'th word of string, blank-separated |
| &writable | 1 | is a file writable |
The &lookup function takes two arguments. The first is a keyword and the second is a filename. Keywords may be combined with '+', e.g., r+bin to find a readable file in the directory where vile's executable is. The keywords are for location:
| bin | look in vile's directory |
| current | look in the current directory |
| home | look in user's $HOME directory |
| libdir | look along $libdir-path |
| path | look along user's $PATH |
| startup | look along $startup-path |
| execable | test if file is exec'able |
| readable | test if file is readable |
| writable | test if file is writable |
The &path function takes two arguments. The first is a keyword and the second is a pathname. Keywords are: end (suffix of the filename), full (absolute path), head (directory), root (filename without suffix), short (relative path), tail (filename).
| Name | Description | |
|---|---|---|
~break | exit a ~while loop | |
~else | default conditional execution | |
~elseif cond | alternate conditional execution | |
~elsewith tokens | alterate tokens to following commands | |
~endif | finish conditional execution | |
~endm | finish a macro | |
~endwhile | finish a ~while loop | |
~endwith | finish a ~with block | |
~force | force macro to continue even if command fails | |
~goto label | jump to a label in the current macro | |
~hidden | do not update screen while the macro executes | |
~if cond | start conditional execution | |
~local vars | save specified variables, restore when macro terminates | |
~quiet | suppress messages while the macro executes | |
~return | terminate current macro | |
~trace cond | set $debug trace | |
~while cond | execute a loop if the condition is true | |
~with tokens | prepend tokens to following commands |
Line labels begin with a "*" as the first nonblank char, like:
*LBL01
~goto LBL01
In addition to the state variables, you may set and use the values of the editor modes (i.e., universal modes, buffer-only modes or window-only modes), e.g., "setv $dos=true". The global values of the editor modes are not visible to the expression evaluator.
User-defined variables can also be set and used; their names are prefixed with the '%' character.
Response variables (a '@' followed by a prompt-string) cause vile to prompt for input with the given prompt-string.
Buffer variables (a '<' followed by a buffer name) return the current line of the specified buffer, automatically setting the position to the next line.
| Name | Args | Description |
|---|---|---|
| &abs | 1 | absolute value of a number |
| &add | 2 | add two numbers together |
| &and | 2 | logical and |
| &ascii | 1 | char to integer conversion |
| &bchanged | 1 | true if given buffer is modified |
| &bind | 1 | lookup what function name is bound to key |
| &cat | 2 | concatenate string |
| &cclass | 1 | character class (see "show-printable") |
| &chr | 1 | integer to char conversion |
| &classof | 1 | inverse of &isa, returns classes for param |
| &cmatch | 2 | caseless match regular-expression value |
| &date | 2 | format 2nd param with 1st, like strftime. |
| &default | 1 | initial/default value for mode or state variable |
| ÷ | 2 | division |
| &dquery | 2 | prompt user for input, given default value |
| &env | 1 | retrieve a system environment variable |
| &equal | 2 | numeric equality |
| &error | 1 | true if the parameter was ERROR |
| &execable | 1 | true if file is exec'able |
| &fchanged | 1 | true if file for given buffer is modified |
| &filter | 1 | true if the given majormode's filter is builtin |
| &ftime | 1 | modification-time of the given file, as a number |
| &geq | 2 | numeric greater than or equal |
| &global | 1 | retrieves global mode setting |
| &greater | 2 | numeric greater than |
| > | 2 | numeric greater than |
| >key | 0 | get 1 character |
| >motion | 1 | get keycode motion sequence for the binding |
| >sequence | 0 | get keycode sequence, e.g., #1 |
| &indirect | 1 | evaluate indirect value |
| &isa | 2 | check if the second param is a member of first |
| &left | 2 | left string(string, len) |
| &length | 1 | string length |
| &leq | 2 | numeric less than or equal |
| &lessthan | 2 | numeric less than |
| &local | 1 | retrieves local mode setting |
| &lookup | 2 | look for filename (see below for arguments) |
| &lower | 1 | lower case string |
| < | 2 | numeric less than |
| &match | 2 | match regular-expression value |
| &mclass | 1 | returns the mode's class, e.g., buffer or Major |
| &middle | 3 | mid string(string, pos, len) |
| &modulo | 2 | modulus |
| &negate | 1 | negate |
| &neq | 2 | numeric inequality |
| ¬ | 1 | logical not |
| &or | 2 | logical or |
| &path | 2 | extract/translate pathname (see below for args) |
| &pcat | 2 | concatenate directory and filename |
| &pquote | 1 | quote pathname if needed, e.g., embedded spaces |
| &qpasswd | 1 | prompt user for password string |
| &query | 1 | prompt user for input |
| &random | 1 | get a random number from 1 to n |
| &rd | 1 | is a file readable |
| &readable | 1 | is a file readable |
| ®ister | 1 | value of register (1-character name) |
| &right | 2 | right string(string, pos) |
| &rnd | 1 | get a random number from 1 to n |
| &sequal | 2 | string logical equality check |
| &sgeq | 2 | string greater than or equal |
| &sgreater | 2 | string logical greater than |
| &sgt | 2 | string greater than |
| &sindex | 2 | find the index of second string in first |
| &sleq | 2 | string less than or equal |
| &sless | 2 | string logical less than |
| &slt | 2 | string less than |
| &sneq | 2 | string inequality |
| &stime | 1 | system-time, as a number |
| &stoken | 3 | true if token found in string, given delims |
| &subtract | 2 | subtraction |
| × | 2 | multiplication |
| &token | 3 | select n'th token of string, given delims |
| &translate | 3 | translate "from" to "to" for given string. |
| &trim | 1 | trim whitespace from string |
| &upper | 1 | uppercase string |
| &word | 2 | select n'th word of string, blank-separated |
| &writable | 1 | is a file writable |
The &lookup function takes two arguments. The first is a keyword and the second is a filename. Keywords may be combined with '+', e.g., r+bin to find a readable file in the directory where vile's executable is. The keywords are for location:
| bin | look in vile's directory |
| current | look in the current directory |
| home | look in user's $HOME directory |
| libdir | look along $libdir-path |
| path | look along user's $PATH |
| startup | look along $startup-path |
| execable | test if file is exec'able |
| readable | test if file is readable |
| writable | test if file is writable |
The &path function takes two arguments. The first is a keyword and the second is a pathname. Keywords are: end (suffix of the filename), full (absolute path), head (directory), root (filename without suffix), short (relative path), tail (filename).
| Name | Description | |
|---|---|---|
~break | exit a ~while loop | |
~else | default conditional execution | |
~elseif cond | alternate conditional execution | |
~elsewith tokens | alterate tokens to following commands | |
~endif | finish conditional execution | |
~endm | finish a macro | |
~endwhile | finish a ~while loop | |
~endwith | finish a ~with block | |
~force | force macro to continue even if command fails | |
~goto label | jump to a label in the current macro | |
~hidden | do not update screen while the macro executes | |
~if cond | start conditional execution | |
~local vars | save specified variables, restore when macro terminates | |
~quiet | suppress messages while the macro executes | |
~return | terminate current macro | |
~trace cond | set $debug trace | |
~while cond | execute a loop if the condition is true | |
~with tokens | prepend tokens to following commands |
Line labels begin with a "*" as the first nonblank char, like:
*LBL01
~goto LBL01
In addition to the state variables, you may set and use the values of the editor modes (i.e., universal modes, buffer-only modes or window-only modes), e.g., "setv $dos=true". The global values of the editor modes are not visible to the expression evaluator.
User-defined variables can also be set and used; their names are prefixed with the '%' character.
Response variables (a '@' followed by a prompt-string) cause vile to prompt for input with the given prompt-string.
Buffer variables (a '<' followed by a buffer name) return the current line of the specified buffer, automatically setting the position to the next line.
| Name | Args | Description |
|---|---|---|
| &abs | 1 | absolute value of a number |
| &add | 2 | add two numbers together |
| &and | 2 | logical and |
| &ascii | 1 | char to integer conversion |
| &bchanged | 1 | true if given buffer is modified |
| &bind | 1 | lookup what function name is bound to key |
| &cat | 2 | concatenate string |
| &cclass | 1 | character class (see "show-printable") |
| &chr | 1 | integer to char conversion |
| &classof | 1 | inverse of &isa, returns classes for param |
| &cmatch | 2 | caseless match regular-expression value |
| &date | 2 | format 2nd param with 1st, like strftime. |
| &default | 1 | initial/default value for mode or state variable |
| ÷ | 2 | division |
| &dquery | 2 | prompt user for input, given default value |
| &env | 1 | retrieve a system environment variable |
| &equal | 2 | numeric equality |
| &error | 1 | true if the parameter was ERROR |
| &execable | 1 | true if file is exec'able |
| &fchanged | 1 | true if file for given buffer is modified |
| &filter | 1 | true if the given majormode's filter is builtin |
| &ftime | 1 | modification-time of the given file, as a number |
| &geq | 2 | numeric greater than or equal |
| &global | 1 | retrieves global mode setting |
| &greater | 2 | numeric greater than |
| > | 2 | numeric greater than |
| >key | 0 | get 1 character |
| >motion | 1 | get keycode motion sequence for the binding |
| >sequence | 0 | get keycode sequence, e.g., #1 |
| &indirect | 1 | evaluate indirect value |
| &isa | 2 | check if the second param is a member of first |
| &left | 2 | left string(string, len) |
| &length | 1 | string length |
| &leq | 2 | numeric less than or equal |
| &lessthan | 2 | numeric less than |
| &local | 1 | retrieves local mode setting |
| &lookup | 2 | look for filename (see below for arguments) |
| &lower | 1 | lower case string |
| < | 2 | numeric less than |
| &match | 2 | match regular-expression value |
| &mclass | 1 | returns the mode's class, e.g., buffer or Major |
| &middle | 3 | mid string(string, pos, len) |
| &modulo | 2 | modulus |
| &negate | 1 | negate |
| &neq | 2 | numeric inequality |
| ¬ | 1 | logical not |
| &or | 2 | logical or |
| &path | 2 | extract/translate pathname (see below for args) |
| &pcat | 2 | concatenate directory and filename |
| &pquote | 1 | quote pathname if needed, e.g., embedded spaces |
| &qpasswd | 1 | prompt user for password string |
| &query | 1 | prompt user for input |
| &random | 1 | get a random number from 1 to n |
| &rd | 1 | is a file readable |
| &readable | 1 | is a file readable |
| ®ister | 1 | value of register (1-character name) |
| &right | 2 | right string(string, pos) |
| &rnd | 1 | get a random number from 1 to n |
| &sequal | 2 | string logical equality check |
| &sgeq | 2 | string greater than or equal |
| &sgreater | 2 | string logical greater than |
| &sgt | 2 | string greater than |
| &sindex | 2 | find the index of second string in first |
| &sleq | 2 | string less than or equal |
| &sless | 2 | string logical less than |
| &slt | 2 | string less than |
| &sneq | 2 | string inequality |
| &stime | 1 | system-time, as a number |
| &stoken | 3 | true if token found in string, given delims |
| &subtract | 2 | subtraction |
| × | 2 | multiplication |
| &token | 3 | select n'th token of string, given delims |
| &translate | 3 | translate "from" to "to" for given string. |
| &trim | 1 | trim whitespace from string |
| &upper | 1 | uppercase string |
| &word | 2 | select n'th word of string, blank-separated |
| &writable | 1 | is a file writable |
The &lookup function takes two arguments. The first is a keyword and the second is a filename. Keywords may be combined with '+', e.g., r+bin to find a readable file in the directory where vile's executable is. The keywords are for location:
| bin | look in vile's directory |
| current | look in the current directory |
| home | look in user's $HOME directory |
| libdir | look along $libdir-path |
| path | look along user's $PATH |
| startup | look along $startup-path |
| execable | test if file is exec'able |
| readable | test if file is readable |
| writable | test if file is writable |
The &path function takes two arguments. The first is a keyword and the second is a pathname. Keywords are: end (suffix of the filename), full (absolute path), head (directory), root (filename without suffix), short (relative path), tail (filename).
| Name | Description | |
|---|---|---|
~break | exit a ~while loop | |
~else | default conditional execution | |
~elseif cond | alternate conditional execution | |
~elsewith tokens | alterate tokens to following commands | |
~endif | finish conditional execution | |
~endm | finish a macro | |
~endwhile | finish a ~while loop | |
~endwith | finish a ~with block | |
~force | force macro to continue even if command fails | |
~goto label | jump to a label in the current macro | |
~hidden | do not update screen while the macro executes | |
~if cond | start conditional execution | |
~local vars | save specified variables, restore when macro terminates | |
~quiet | suppress messages while the macro executes | |
~return | terminate current macro | |
~trace cond | set $debug trace | |
~while cond | execute a loop if the condition is true | |
~with tokens | prepend tokens to following commands |
Line labels begin with a "*" as the first nonblank char, like:
*LBL01
~goto LBL01
In addition to the state variables, you may set and use the values of the editor modes (i.e., universal modes, buffer-only modes or window-only modes), e.g., "setv $dos=true". The global values of the editor modes are not visible to the expression evaluator.
User-defined variables can also be set and used; their names are prefixed with the '%' character.
Response variables (a '@' followed by a prompt-string) cause vile to prompt for input with the given prompt-string.
Buffer variables (a '<' followed by a buffer name) return the current line of the specified buffer, automatically setting the position to the next line.
| Name | Args | Description |
|---|---|---|
| &abs | 1 | absolute value of a number |
| &add | 2 | add two numbers together |
| &and | 2 | logical and |
| &ascii | 1 | char to integer conversion |
| &bchanged | 1 | true if given buffer is modified |
| &bind | 1 | lookup what function name is bound to key |
| &cat | 2 | concatenate string |
| &cclass | 1 | character class (see "show-printable") |
| &chr | 1 | integer to char conversion |
| &classof | 1 | inverse of &isa, returns classes for param |
| &cmatch | 2 | caseless match regular-expression value |
| &date | 2 | format 2nd param with 1st, like strftime. |
| &default | 1 | initial/default value for mode or state variable |
| ÷ | 2 | division |
| &dquery | 2 | prompt user for input, given default value |
| &env | 1 | retrieve a system environment variable |
| &equal | 2 | numeric equality |
| &error | 1 | true if the parameter was ERROR |
| &execable | 1 | true if file is exec'able |
| &fchanged | 1 | true if file for given buffer is modified |
| &filter | 1 | true if the given majormode's filter is builtin |
| &ftime | 1 | modification-time of the given file, as a number |
| &geq | 2 | numeric greater than or equal |
| &global | 1 | retrieves global mode setting |
| &greater | 2 | numeric greater than |
| > | 2 | numeric greater than |
| >key | 0 | get 1 character |
| >motion | 1 | get keycode motion sequence for the binding |
| >sequence | 0 | get keycode sequence, e.g., #1 |
| &indirect | 1 | evaluate indirect value |
| &isa | 2 | check if the second param is a member of first |
| &left | 2 | left string(string, len) |
| &length | 1 | string length |
| &leq | 2 | numeric less than or equal |
| &lessthan | 2 | numeric less than |
| &local | 1 | retrieves local mode setting |
| &lookup | 2 | look for filename (see below for arguments) |
| &lower | 1 | lower case string |
| < | 2 | numeric less than |
| &match | 2 | match regular-expression value |
| &mclass | 1 | returns the mode's class, e.g., buffer or Major |
| &middle | 3 | mid string(string, pos, len) |
| &modulo | 2 | modulus |
| &negate | 1 | negate |
| &neq | 2 | numeric inequality |
| ¬ | 1 | logical not |
| &or | 2 | logical or |
| &path | 2 | extract/translate pathname (see below for args) |
| &pcat | 2 | concatenate directory and filename |
| &pquote | 1 | quote pathname if needed, e.g., embedded spaces |
| &qpasswd | 1 | prompt user for password string |
| &query | 1 | prompt user for input |
| &random | 1 | get a random number from 1 to n |
| &rd | 1 | is a file readable |
| &readable | 1 | is a file readable |
| ®ister | 1 | value of register (1-character name) |
| &right | 2 | right string(string, pos) |
| &rnd | 1 | get a random number from 1 to n |
| &sequal | 2 | string logical equality check |
| &sgeq | 2 | string greater than or equal |
| &sgreater | 2 | string logical greater than |
| &sgt | 2 | string greater than |
| &sindex | 2 | find the index of second string in first |
| &sleq | 2 | string less than or equal |
| &sless | 2 | string logical less than |
| &slt | 2 | string less than |
| &sneq | 2 | string inequality |
| &stime | 1 | system-time, as a number |
| &stoken | 3 | true if token found in string, given delims |
| &subtract | 2 | subtraction |
| × | 2 | multiplication |
| &token | 3 | select n'th token of string, given delims |
| &translate | 3 | translate "from" to "to" for given string. |
| &trim | 1 | trim whitespace from string |
| &upper | 1 | uppercase string |
| &word | 2 | select n'th word of string, blank-separated |
| &writable | 1 | is a file writable |
The &lookup function takes two arguments. The first is a keyword and the second is a filename. Keywords may be combined with '+', e.g., r+bin to find a readable file in the directory where vile's executable is. The keywords are for location:
| bin | look in vile's directory |
| current | look in the current directory |
| home | look in user's $HOME directory |
| libdir | look along $libdir-path |
| path | look along user's $PATH |
| startup | look along $startup-path |
| execable | test if file is exec'able |
| readable | test if file is readable |
| writable | test if file is writable |
The &path function takes two arguments. The first is a keyword and the second is a pathname. Keywords are: end (suffix of the filename), full (absolute path), head (directory), root (filename without suffix), short (relative path), tail (filename).
| Name | Description | |
|---|---|---|
~break | exit a ~while loop | |
~else | default conditional execution | |
~elseif cond | alternate conditional execution | |
~elsewith tokens | alterate tokens to following commands | |
~endif | finish conditional execution | |
~endm | finish a macro | |
~endwhile | finish a ~while loop | |
~endwith | finish a ~with block | |
~force | force macro to continue even if command fails | |
~goto label | jump to a label in the current macro | |
~hidden | do not update screen while the macro executes | |
~if cond | start conditional execution | |
~local vars | save specified variables, restore when macro terminates | |
~quiet | suppress messages while the macro executes | |
~return | terminate current macro | |
~trace cond | set $debug trace | |
~while cond | execute a loop if the condition is true | |
~with tokens | prepend tokens to following commands |
Line labels begin with a "*" as the first nonblank char, like:
*LBL01
~goto LBL01
In addition to the state variables, you may set and use the values of the editor modes (i.e., universal modes, buffer-only modes or window-only modes), e.g., "setv $dos=true". The global values of the editor modes are not visible to the expression evaluator.
User-defined variables can also be set and used; their names are prefixed with the '%' character.
Response variables (a '@' followed by a prompt-string) cause vile to prompt for input with the given prompt-string.
Buffer variables (a '<' followed by a buffer name) return the current line of the specified buffer, automatically setting the position to the next line.
| Name | Args | Description |
|---|---|---|
| &abs | 1 | absolute value of a number |
| &add | 2 | add two numbers together |
| &and | 2 | logical and |
| &ascii | 1 | char to integer conversion |
| &bchanged | 1 | true if given buffer is modified |
| &bind | 1 | lookup what function name is bound to key |
| &cat | 2 | concatenate string |
| &cclass | 1 | character class (see "show-printable") |
| &chr | 1 | integer to char conversion |
| &classof | 1 | inverse of &isa, returns classes for param |
| &cmatch | 2 | caseless match regular-expression value |
| &date | 2 | format 2nd param with 1st, like strftime. |
| &default | 1 | initial/default value for mode or state variable |
| ÷ | 2 | division |
| &dquery | 2 | prompt user for input, given default value |
| &env | 1 | retrieve a system environment variable |
| &equal | 2 | numeric equality |
| &error | 1 | true if the parameter was ERROR |
| &execable | 1 | true if file is exec'able |
| &fchanged | 1 | true if file for given buffer is modified |
| &filter | 1 | true if the given majormode's filter is builtin |
| &ftime | 1 | modification-time of the given file, as a number |
| &geq | 2 | numeric greater than or equal |
| &global | 1 | retrieves global mode setting |
| &greater | 2 | numeric greater than |
| > | 2 | numeric greater than |
| >key | 0 | get 1 character |
| >motion | 1 | get keycode motion sequence for the binding |
| >sequence | 0 | get keycode sequence, e.g., #1 |
| &indirect | 1 | evaluate indirect value |
| &isa | 2 | check if the second param is a member of first |
| &left | 2 | left string(string, len) |
| &length | 1 | string length |
| &leq | 2 | numeric less than or equal |
| &lessthan | 2 | numeric less than |
| &local | 1 | retrieves local mode setting |
| &lookup | 2 | look for filename (see below for arguments) |
| &lower | 1 | lower case string |
| < | 2 | numeric less than |
| &match | 2 | match regular-expression value |
| &mclass | 1 | returns the mode's class, e.g., buffer or Major |
| &middle | 3 | mid string(string, pos, len) |
| &modulo | 2 | modulus |
| &negate | 1 | negate |
| &neq | 2 | numeric inequality |
| ¬ | 1 | logical not |
| &or | 2 | logical or |
| &path | 2 | extract/translate pathname (see below for args) |
| &pcat | 2 | concatenate directory and filename |
| &pquote | 1 | quote pathname if needed, e.g., embedded spaces |
| &qpasswd | 1 | prompt user for password string |
| &query | 1 | prompt user for input |
| &random | 1 | get a random number from 1 to n |
| &rd | 1 | is a file readable |
| &readable | 1 | is a file readable |
| ®ister | 1 | value of register (1-character name) |
| &right | 2 | right string(string, pos) |
| &rnd | 1 | get a random number from 1 to n |
| &sequal | 2 | string logical equality check |
| &sgeq | 2 | string greater than or equal |
| &sgreater | 2 | string logical greater than |
| &sgt | 2 | string greater than |
| &sindex | 2 | find the index of second string in first |
| &sleq | 2 | string less than or equal |
| &sless | 2 | s |