This file has many hypertext links. Use them! If you're using elvis 2.0 to browse this file, then hypertextual references will appear as underlined text. To follow the hypertext link, move the cursor onto the underlined text and press (Enter). To go back, press (Control-T). The (Tab) key moves the cursor forward to the next hypertext reference.
If elvis 2.0p doesn't automatically start up in HTML mode when you view this file, then you'll need to force it into HTML mode by giving the command ":display html".
But I believe it is stable. I have used it for hundreds of hours under Linux, and have also spent a solid day or two using it under WindowsNT. (And maybe 45 minutes under MS-DOS, ouch!) Elvis is now very close to being released.
This particular beta-test version only works under UNIX, MS-DOS, and (as a console application) under WindowsNT. The WindowsNT version should work under Windows95 as well, but I haven't verified this. Eventually, I expect to support OS/2 and MacOS, but this release is for UNIX, MS-DOS, and Win32 only.
Step 1 for any UNIX site is always to run the configure script. Usually that'll perform all of the localization that is required, but no doubt a few sites will require extra tweaking of the Makefile and config.h files.
Typically, you will run configure without any arguments. The script will obtain the name of your operating system via the "uname" command, and will examine your system's files to see which features you have installed. This is a pretty smart shell script.
You may need to explicitly give an argument if, for example, you have X-windows installed but don't want elvis to use it. Another good reason to supply arguments would be to override the default installation directories. The following options are supported:
The X-windows header files are actually expected to reside in a subdirectory named "X11" under the given directory. For example, if your system has a file named /usr/local/X11R6/include/X11/X.h then you would give the argument
The other files in the osunix directory probably won't need to be modified either, and you can ignore them for now.
If it seems to be working, you can make it accessible outside the source directory by becoming super-user and giving the command
To remove elvis, become the super-user and give the command
The command ":all command" applies an ex command to all user buffers, and ":all! command" applies an ex command to all buffers including internal ones. An example of this would be ":all set filename? readonly?" which tells you the status of each buffer's "readonly" option.
Any ex command can be preceded by a buffer name in parentheses. This indicates that the command should be applied to that buffer instead of the default buffer. For example, ":(foo)set noreadonly" turns off the readonly option for the buffer "foo" even if we're editing some other buffer.
To switch from one buffer to another, enter an ex command line which contains only the name of the desired buffer in parentheses. For example, the command ":(foo)" would cause elvis to switch to the buffer "foo". (This is intended to be analogous to giving just a line number when you want to move the cursor to a given line, as in ":10" to move to line 10.)
Currently, the most important interfaces are named "x11" and "termcap". By default, elvis will use the x11 interface if the DISPLAY environment variable is set, and the termcap interface otherwise. Currently both of these are very basic, but I expect them to become more elaborate over time.
The "x11" interface allows you to use the mouse to move the cursor or select text. Dragging the mouse with the left button pressed selects characters; the middle button selects a rectangular region of text; and the right button selects whole lines. Clicking the left button (without dragging) cancels any pending selection and moves the cursor; the middle button simulates keystrokes like xterm; the right button moves the cursor like the left button, except that the right button doesn't cancel any pending selection. As a special case, clicking the left button on the text cursor will simulate a ^] command, which performs tag lookup... so, in effect, double-clicking on a word performs tag lookup on that word. When using the "x11" interface, elvis recognizes some additional command-line flags: -fn font to set the normal font, -fb font to set the bold font, -fi font to set the italic font, and -noicon to prevent elvis from using its built-in icon.
Code is also provided for a "curses" interface, but I don't recommend it. I wrote this interface mostly to prove that it could be done.
Elvis supports most of the same window commands as vim. This includes commands such as ":split" to create a new window, and ^W ^W to switch to a different window.
Each window can be in a different display mode. You set the display mode via the ":dis mode" command. The command ":dis" (with no mode) lists all available modes, with an asterisk next to the one that this window is currently using. There is also a ":no" command which is short for ":dis normal".
Each buffer has a "bufdisplay" option. Each time a window starts to display a buffer, the window's display mode is set according to the buffer's bufdisplay option.
In visual command mode, ^W d toggles between "normal" mode and the buffer's bufdisplay mode. If the buffer's bufdisplay option is also "normal", then ^W d toggles between "normal" and "hex" modes.
Throughout the life of elvis 1.x, I was always concerned about how to distribute elvis' documentation. Many users don't have access to troff; they prefer plain text documentation. But people who do have troff would prefer to use it when printing the documentation, because the resulting output is prettier than a plain-text file. For elvis 2.0, this won't be an issue because I'll distribute the documentation in the form of HTML documents, and people who have Netscape or another fancy HTML reader can use it to print the documentation. People who have no fancy HTML readers can still print the documentation using elvis itself.
The command for printing a buffer is ":lpr" (which can be abbreviated to ":lp"). But before you do that, you'll need to set some options...
.-----------.------------------------------------. | OPTION | MEANING | |-----------|------------------------------------| | lpcolumns | Width of the printer, in columns | | lpconvert | Convert Latin-1 chars to PC-8? | | lpcrlf | Convert newlines to CR-LF pairs? | | lplines | Length of the page, in lines | | lpout | Print spooler program, or filename | | lptype | Printer type (see below) | | lpwrap | Wrap long lines? (else clip them) | ^-----------^------------------------------------^The most important option is "lptype", since it controls what type of escape codes (or whatever) elvis will use to perform font changes. The default value is "lptype=dumb" which is the most conservative value -- it doesn't attempt to perform any font changes. The complete list of acceptable values is:
.-------.----------------------------------------------. | VALUE | PRINTER DESCRIPTION | |-------|----------------------------------------------| | ps | PostScript, one logical page per sheet | | ps2 | PostScript, two logical pages per sheet | | epson | Most dot-matrix printers, no graphic chars | | pana | Panasonic dot-matrix printers | | ibm | Dot-matrix printers with IBM graphic chars | | hp | HP printers, and most non-PostScript lasers | | cr | Line printers, overtypes via carriage-return | | bs | Overtypes via backspace, like nroff | | dumb | Plain ASCII, no font control | ^-------^----------------------------------------------^
Strings are supported. Any two strings (or expressions which evaulate to strings) placed side-by-side with no operator between them will have their values concatenated. You can truncate strings using "string<<length" or "string>>length".
There are several built-in functions. When you call one of these functions, there must not be any whitespace between the function name and the following parenthesis. The built-in functions are:
.------------------.--------------------------------------------. | FUNCTION(ARG) | RETURN VALUE | |------------------|--------------------------------------------| | strlen(string) | number of characters in the string | | toupper(string) | uppercase version of string | | tolower(string) | lowercase version of string | | isnumber(string) | "true" iff string is a decimal number | | hex(number) | string of hex digits representing number | | octal(number) | string of octal digits representing number | | char(number) | convert number to 1 ASCII char, as a string| | exists(path) | "true" iff file exists | | dirperm(path) | string indicating file attributes | | dirfile(path) | filename.ext part of a path | | dirname(path) | directory part of a pathname | | dirdir(path) | directory, like dirname(file) | | dirext(path) | extension (including the . ) | | basename(path) | filename without extension | | elvispath(file) | locate a file in elvis' configuration path | | knownsyntax(file)| "true" iff file type is listed in elvis.syn| | buffer(bufname) | "true" iff buffer exist | | feature(name) | "true" iff a given feature is supported | ^------------------^--------------------------------------------^
Expressions are used by several commands, including the ":if expression" command. The ":and" and ":or" commands of elvis 1.8 have been removed since ":if" can easily achieve the same effect simply by using the && or || operators.
There is also a ":let option=expression" command, which evaluates the expression and sets the option to the resulting value. Note that unlike :set, :let can only assign a value to a single option at a time.
There is also a ":calc expression" command which simply displays the result of the expression. Also, if you visibly select some characters (using the v command) and then apply the = operator to those characters, elvis will evaluate the selected text and replace it with the result. When = is applied to lines, it still runs an external filter program just as it did in version 1.8.
A slightly different expression syntax is used by the ":eval expression" command. The expression is mostly left unchanged, except that text inside parentheses is evaluated in the normal syntax. Outside of parentheses the only characters that have special meaning are \ and $NAME. The :eval command is used calculate commands and then execute them. For example, during initialization elvis performs a ":eval $EXINIT" to execute the value of the EXINIT environment variable.
When elvis starts up, it looks for a file named "elvis.ini". If this file is found, its contents are executed as a series of ex commands. The default "elvis.ini" file performs the traditional vi initialization such as ":source $HOME/.exrc". By changing this file, you can completely change the way elvis initializes itself. As a mild example, you could make it read .elvisrc instead of .exrc.
After interpretting "elvis.ini", elvis looks for a few more files right away. If it finds them, it loads them into internal edit buffers right away but doesn't interpret them yet. The most interesting ones are "elvis.arf" and "elvis.bwf".
The "elvis.brf" file is interpretted Before Reading a File into an edit buffer. Typically, this will set the buffer's "binary" option, depending on its file name extension.
The "elvis.arf" file is interpretted After Reading a File into an edit buffer. Typically, this will set the buffer's "bufdisplay" option, depending on its file name extension.
The "elvis.bwf" files is interpretted Before Writing the File back out again. It will typically be used to copy the original file to "filename.bak" or something like that.
Elvis also supports an "elvis.awf" files, but I haven't found much use for it yet. Perhaps it could tie-in to a revision control system?
You can use an "elvis.msg" file to translate the normal terse messages into verbose messages. This is meant to allow elvis to issue messages in a local language. Each time elvis issues a message, it attempts to look for a line that looks like "terse message: verbose message" and if found it will substitute the verbose message for the terse one. Messages are then subjected to the same sort of evaluation as for the ":eval expression" command, with $1 through $9 used to represent any arguments of the message.
When this new elvis process starts up, it will be displaying a new, empty buffer. Don't panic! Your edit buffer is still intact; it just doesn't happen to be displayed in the initial window.
After a crash, the session file might not be entirely self-consistent. Because of this, it is dangerous to edit the file using this session file. You should save your old buffer to a file immediately, and then exit elvis. To save your old buffer give elvis the command ":(buffer)w filename" where buffer is the name of your buffer (usually the same as the original file name) and filename is the name of a new file where you wish to store the text. For safety's sake, you should not write the salvaged buffer out over the top of the original text file.
After exiting, you should give the command "rm core ~/elvis*.ses" to delete the core file and the damaged session file. (For DOS/Windows users, the command is "DEL ELVIS*.SES".)
If you can figure out how to reproduce the problem, please let me know! My email address is:
kirkenda@cs.pdx.edu Please mention the elvis version number in your message's "Subject:" line.