• 1. ABOUT THIS FILE
  • 2. THIS IS A BETA-TEST VERSION
  • 3. COMPILING
  • 4. NEW FEATURES
  • 5. WHEN THINGS GO WRONG
  • 6. LINKS TO RELATED FILES
  • 1. ABOUT THIS FILE

    This file is written in the HTML markup language. You can view it with any WWW viewer, such as Mosaic or Netscape. You can also use elvis 2.0p-beta to view it; this version of elvis has the ability to view HTML documents, and print them.

    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".

    2. THIS IS A BETA-TEST VERSION

    This is a beta-test version of elvis, so don't be surprised if it crashes. The only reason I'm making this version available is so that I can receive bug reports. If you aren't willing to suffer core dumps, and report them to me politely, then don't use this software!

    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.

    3. COMPILING & INSTALLING

    The "INSTALL" file contains instructions for how to compile elvis for supported versions of UNIX, for WindowsNT/Windows95 using Visual C++ 2.0 (or later), and for MS-DOS using Visual C++ 1.5. The rest of this section only applies if you're trying to compile elvis on an unsupported version of UNIX.

    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.

    3.1 The configure script

    I tried to make this act a lot like the GNU configure scripts, but it wasn't created by GNU's autoconf.

    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:

    --with-x[=no]
    This forces elvis to include support for X-windows, or (with "=no") forces it not to support X-windows. If you omit this flag, configure will automatically detect whether X is installed on your system, and use it if available.
    --without-x
    This is a synonym for "--with-x=no".
    --x-includes=directory
    configure has a built-in list if likely places where X-windows header files might be installed. This argument adds another possible location to the list. The list is used for the automatic inspection if "--with-x[=no]" was omitted, and the actual directory where the files were found are incorporated into the Makefile.

    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

    --x-includes=/usr/local/X11R6/include
    --x-libraries=directory
    Similarly, this adds a directory to the list of directories where X-windows libraries might reside. The directory where they actually do reside is incorporated into the Makefile.
    --bindir=directory
    This value is incorporated into the Makefile. The command "make install" will copy the executables into this directory. The default is /usr/local/bin.
    --datadir=directory
    This is incorporated into both the Makefile and the config.h file. It is the directory where elvis' support files will reside after a "make install". The default is /usr/local/lib/elvis.
    --libs=string
    This option allows you to specify which library to use for the "termcap" user interface. It will usually be either -ltermcap or -lcurses.
    --ioctl=tty-style
    There are three possibilities: termios, termio, and sgtty. These use Posix, SysV, and BSD terminal control calls, respectively. The Posix termios calls usually work best. The default is chosen by inspecting the header files in /usr/include.

    3.2 osunix directory.

    You probably don't need to modify the osunix/osdef.h file, but you should read through it. It is heavily commented and should be fairly self-explanatory. It defines macros that are used in OS-independent parts of elvis, such as for initialization of options.

    The other files in the osunix directory probably won't need to be modified either, and you can ignore them for now.

    3.3 INSTALLING

    You can test elvis without installing it, by running it in its source code directory. Try running "elvis README.html". (UNIX users may prefer to try "e2 README.html". e2 is a shell script which runs elvis in such a way that it looks for its support files in the lib subdirectory.)

    If it seems to be working, you can make it accessible outside the source directory by becoming super-user and giving the command

    make install This copies the executable, elvis, to the /usr/local/bin directory, and the supporting data files from lib to /usr/local/lib/elvis.

    To remove elvis, become the super-user and give the command

    make uninstall This deletes the relevent files from the /usr/local hierarchy, but leaves the original files in elvis' source directory intact.

    4. NEW FEATURES (Relative to elvis 1.8pl4)

    There are a lot of new features. The major ones are:

    4.1 Multiple edit buffers

    You can be editing many files concurrently. Also, elvis uses some buffers internally, in addition to the buffers that are created for holding your files. The command ":bu" lists the buffers that hold your files, and ":bu!" (with a !) lists all buffers.

    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.)

    4.2 Multiple user interfaces

    A single elvis executable can contain several user interfaces. Each time elvis starts up it will choose one and use that interface until elvis exits. The usage message lists the available user interfaces; to see this message, give the shell command "elvis -?".

    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.

    4.3 Multiple windows (if the user interface supports them)

    Both the x11 and termcap interfaces support multiple windows. (The x11 interface creates a new top-level application window for each editing window, and the termcap interface subdivides the screen.) Each window can show a different edit buffer, or different windows can show the same buffer. In the latter case, any changes made in one window are immediately reflected in all windows that show that buffer.

    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.

    4.4 A variety of display modes

    Display modes determine how a text is displayed. Elvis supports display modes named "normal", "syntax", "hex", "html", and "man".

    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.

    4.5 Hardcopy from within elvis

    Elvis uses its display modes when sending text to the printer, just as it does when updating the window. Consequently elvis can be used to print hex dumps, pretty-printed C code, or formatted HTML documents or "man" pages.

    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                 |
    ^-------^----------------------------------------------^
    

    4.6 C-like expression evaluator

    Elvis has a built-in calculator which uses a syntax resembling C expressions. The names of options can be used in place of variables, and you can also use "$NAME" to access the value of an environment variable.

    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.

    4.7 Extremely customizable

    NOTE: In the following paragraphs, when I say elvis "looks for" a file, I mean that it searches through any directories named in the value of the "elvispath" option.

    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.

    4.8 Online help

    The command ":help" reads the file elvis.html (which is an HTML document) and displays it in a separate window. When ":help" is run with no arguments, it lists the Table of Contents which has hypertext links to all the rest of the documentation. You can also supply the name of an ex command, option, or vi command as an argument to jump directly to the relevent part of the documentation. For example, I suggest you try ":help :help" to get a description of the help command itself.

    5. WHEN THINGS GO WRONG

    If elvis crashes, you can restart your edit session via "elvis -r". This will start a new elvis process which uses the old session file.

    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.

    6. LINKS TO RELATED FILES

    Most of the following are binary files, not text or HTML files, so you can't view then with your Web browser. But you can use your browser to download the files.
    Elvis Documentation
    This is the complete on-line HTML Elvis doc.
    untar.c
    This is the complete source code for "untar", a little program which extracts files from a gzipped tar archive. Comments near the top of "untar.c" describe how to compile and use it. If you already have the gzip and tar utilities, then you don't need this.
    untar.exe
    This is an MS-DOS executable, produced from the above "untar.c" file. It should also work under WindowsNT and Windows95. It doesn't support long filenames, but that shouldn't be a problem for the *.tgz files listed below.
    elvis-2.0p.tar.gz
    This is a gzipped tar archive of the source code and documentation for Elvis and its related programs.
    msdosexe.tgz
    This archive contains the documentation and MS-DOS executables for Elvis 2.0.
    win32exe.tgz
    This archive contains the documentation and Win32 executables for Elvis 2.0. These were compiled and tested under WindowsNT, but should work under Windows/95 as well.