kirkenda@eecs.cs.pdx.edu (Steve Kirkendall) (12/04/90)
Elvis is a clone of vi/ex, the standard UNIX editor. Elvis supports nearly all of the vi/ex commands, in both visual mode and colon mode. Elvis runs under BSD UNIX, AT&T SysV UNIX, SCO Xenix, Minix, MS-DOS, Atari TOS, OS9/68000, and Coherent. Ports to other operating systems are in progress; contact me before you start porting it to some other OS, because somebody else may have already done it for you. Elvis is freely redistributable, in either source form or executable form. There are no restrictions on how you may use it. The documentation will reside in a subdirectory called "doc". On some systems, you may need to create this directory before you can extract the documentation. The "doc/*.man" files are UNIX-style man pages; they are meant to be processed by "nroff -man". The "doc/*.doc" files are all chapters of the manual. They have already been formatted, and they contain Epson-compatible escape sequences to control type styles. A program called "refont" is included for stripping these out, if necessary. The file named "Makefile.mix" is used for all systems except MS-DOS. You should copy "Makefile.mix" to "Makefile", and then edit "Makefile" to select the appropriate group of settings for your system. Author: Steve Kirkendall E-mail: kirkenda@cs.pdx.edu Snail 14407 SW Teal Blvd. Apt.C Mail: Beaverton, OR 97005 Phone: (503) 643-6980 : ------------------------ CUT HERE -------------------- test -d doc || mkdir doc || exit 2 if test -f README -a "$1" != -f then echo Will not overwrite README else echo Extracting README sed 's/^X//' >README <<\eof XElvis is a clone of vi/ex, the standard UNIX editor. Elvis supports nearly Xall of the vi/ex commands, in both visual mode and colon mode. X XElvis runs under BSD UNIX, AT&T SysV UNIX, SCO Xenix, Minix, MS-DOS, Atari TOS, XOS9/68000, and Coherent. Ports to other operating systems are in progress; Xcontact me before you start porting it to some other OS, because somebody else Xmay have already done it for you. X XElvis is freely redistributable, in either source form or executable form. XThere are no restrictions on how you may use it. X XThe documentation will reside in a subdirectory called "doc". On some systems, Xyou may need to create this directory before you can extract the documentation. XThe "doc/*.man" files are UNIX-style man pages; they are meant to be processed Xby "nroff -man". The "doc/*.doc" files are all chapters of the manual. They Xhave already been formatted, and they contain Epson-compatible escape sequences Xto control type styles. A program called "refont" is included for stripping Xthese out, if necessary. X XThe file named "Makefile.mix" is used for all systems except MS-DOS. You Xshould copy "Makefile.mix" to "Makefile", and then edit "Makefile" to select Xthe appropriate group of settings for your system. X X XAuthor: Steve Kirkendall X XE-mail: kirkenda@cs.pdx.edu X XSnail 14407 SW Teal Blvd. Apt.C X Mail: Beaverton, OR 97005 X XPhone: (503) 643-6980 eof if test `wc -c <README` -ne 1379 then echo README damaged! fi fi if test -f KNOWN.BUGS -a "$1" != -f then echo Will not overwrite KNOWN.BUGS else echo Extracting KNOWN.BUGS sed 's/^X//' >KNOWN.BUGS <<\eof X(These are sorted by how irritating they are. The worst bugs are at the top.) X X- It is impossible to edit or view the same file more than once. It is X also impossible to invoke Elvis twice with no arguments when in the same X directory. This is caused by the way the temp file is named based on ".", X see function tmpstart() in tmp.c. X X- Inserting characters to make a line longer than BLKSIZE-1 (including the X newline) causes a crash. BLKSIZE is 1024 by default. The shift-J and :join X commands protect against this, but something like "9999a!<Esc>" will make X Elvis misbehave. Also, huge files (more than about 500k) cannot be edited. X X- autoindent is confusingly different from vi when editing typical X indented C code - e.g. after <ESC>o<ESC>xxxxxxxxxxi (x's to column 1) X the last i indents again. X X ^U backspaces to the beginning of the line, but it should only backspace to X the start of auto-indent. (A second ^U could reasonably delete the indent X too) X X- The :@ and :source commands share a single buffer. This means that they X can't call each other. You can't run :source from within your .exrc file X either, for the same reason. X X- Commands which delete text before the cursor, such as `dB', don't move the X cursor, but they should. X X- Using the substitute command, it is not possible to replace with multi- X line text using the ^V^M construct in the replacement string. Vi allows X this as a special case. X X- The Elvis.prj file (used by Turbo-C under MS-DOS) does not force large model X and the text segment is > 64K. X X- The visual "put" commands can't be repeated by hitting ".". X X- "!!ls %" doesn't expand % X X- Sideways scrolling is unacceptable for slow terminals. X X- The ":set number" option is missing, among other things. X X- In DOS, the default colors are not very good. eof if test `wc -c <KNOWN.BUGS` -ne 1818 then echo KNOWN.BUGS damaged! fi fi if test -f doc/intro.doc -a "$1" != -f then echo Will not overwrite doc/intro.doc else echo Extracting doc/intro.doc sed 's/^X//' >doc/intro.doc <<\eof X X Elvis 1.4 INTRODUCTION Page 1-1 X X XE1. INTRODUCTIONF X X Elvis is a clone of vi/ex, the standard UNIX editor. Elvis X supports nearly all of the vi/ex commands, in both visual mode and X colon mode. X X Like vi/ex, elvis stores most of the text in a temporary file, X instead of RAM. This allows it to edit files that are too large to X fit in a single process' data space. X X Elvis runs under BSD UNIX, AT&T SysV UNIX, Minix, MS-DOS, Atari X TOS, Coherent, and OS9/68000. The next version is expected to add X OS/2, VMS, AmigaDos, and MacOS. Contact me before you start X porting it to some other OS, because somebody else may have already X done it for you. X X Elvis is freely redistributable, in either source form or X executable form. There are no restrictions on how you may use it. X X X E1.1 CompilingF X X See the "Versions" section of this manual for instructions on X how to compile Elvis. X X If you want to port Elvis to another O.S. or compiler, then you X should read the "Portability" part of the "Internal" section. X X X E1.2 Overview of ElvisF X X The user interface of elvis/vi/ex is weird. There are two major X command modes in Elvis, and a few text input modes as well. Each X command mode has a command which allows you to switch to the other X mode. X X You will probably use the 4visual command mode5 most of the time. X This is the mode that elvis normally starts up in. X X In visual command mode, the entire screen is filled with lines X of text from your file. Each keystroke is interpretted as part of X a visual command. If you start typing text, it will -1not-0 be X inserted, it will be treated as part of a command. To insert text, X you must first give an "insert text" command. This will take some X getting used to. (An alternative exists. Lookup the "inputmode" X option.) X X The 4colon mode5 is quite different. Elvis displays a ":" X character on the bottom line of the screen, as a prompt. You are X then expected to type in a command line and hit the <Return> key. X The set of commands recognized in the colon mode is different from X visual mode's. X X X X X X X X X X eof if test `wc -c <doc/intro.doc` -ne 2383 then echo doc/intro.doc damaged! fi fi if test -f doc/visual.doc -a "$1" != -f then echo Will not overwrite doc/visual.doc else echo Extracting doc/visual.doc sed 's/^X//' >doc/visual.doc <<\eof X X Elvis 1.4 VISUAL MODE COMMANDS Page 2-1 X X XE2. VISUAL MODE COMMANDSF X X Most visual mode commands are one keystroke long. The following X table lists the operation performed by each keystroke, and also X denotes any options or arguments that it accepts. Notes at the end X of the table describe the notation used in this table. X X In addition to the keys listed here, your keyboard's "arrow" X keys will be interpretted as the appropriate cursor movement X commands. The same goes for <PgUp> and <PgDn>, if your keyboard X has them. There is a colon mode command (to be described later) X which will allow you to define other keys, such as function keys. X X A tip: visual command mode looks a lot like text input mode. If X you forget which mode you're in, just hit the <Esc> key. If elvis X beeps, then you're in visual command mode. If elvis does not beep, X then you were in input mode, but by hitting <Esc> you will have X switched to visual command mode. So, one way or another, after X <Esc> elvis will be ready for a command. X X-1command description type-0 X ^A --- X ^B Move toward the top of the file by 1 screenful X ^C --- Xcount ^D scroll down <count> lines (default 1/2 screen) Xcount ^E scroll up <count> lines X ^F move toward the bottom of the file by 1 screenful X ^G show file status, and the current line # Xcount ^H move left, like h MOVE X ^I --- Xcount ^J move down MOVE X ^K --- X ^L redraw the screen Xcount ^M move to the front of the next line MOVE Xcount ^N move down MOVE X ^O --- Xcount ^P move up MOVE X ^Q --- X ^R redraw the screen X ^S --- X ^T --- Xcount ^U scroll up <count> lines (default 1/2 screen) X ^V --- X ^W --- X ^X --- Xcount ^Y scroll down <count> lines X ^Z --- X ESC --- X ^\ --- X ^] if the cursor is on a tag name, go to that tag X ^^ switch to the previous file, like ":e #" X ^_ --- Xcount SPC move right,like l MOVE X ! mv run the selected lines thru an external filter program X " key select which cut buffer to use next Xcount # + increment a number EDIT X $ move to the rear of the current line MOVE X % move to the matching (){}[] character MOVE X X X X X X Elvis 1.4 VISUAL MODE COMMANDS Page 2-2 X X Xcount & repeat the previous ":s//" command here EDIT X ' key move to a marked line MOVE Xcount ( move backward <count> sentences MOVE Xcount ) move forward <count> sentences MOVE X * go to the next error in the errlist Xcount + move to the front of the next line MOVE Xcount , repeat the previous [fFtT] but in the other direction MOVE Xcount - move to the front of the preceding line MOVE Xcount . repeat the previous "edit" command X / text search forward for a given regular expression MOVE X 0 if not part of count, move to 1st char of this line MOVE X 1 part of count X 2 part of count X 3 part of count X 4 part of count X 5 part of count X 6 part of count X 7 part of count X 8 part of count X 9 part of count X : text run single EX cmd Xcount ; repeat the previous [fFtT] cmd MOVE X < mv shift text left EDIT X = --- X > mv shift text right EDIT X ? text search backward for a given regular expression MOVE X @ key execute the contents of a cut-buffer as VI commands Xcount A inp append at end of the line EDIT Xcount B move back Word MOVE X C inp change text from the cursor through the end of the line EDIT X D delete text from the cursor through the end of the line EDIT Xcount E move end of Word MOVE Xcount F key move leftward to a given character MOVE Xcount G move to line #<count> (default is the bottom line) MOVE Xcount H move to home row (the line at the top of the screen) Xcount I inp insert at the front of the line (after indents) EDIT Xcount J join lines, to form one big line EDIT X K look up keyword Xcount L move to last row (the line at the bottom of the screen) X M move to middle row X N repeat previous search, but in the opposite direction MOVE Xcount O inp open up a new line above the current line EDIT X P paste text before the cursor X Q quit to EX mode X R inp overtype EDIT Xcount S inp change lines, like <count>cc Xcount T key move leftward *almost* to a given character MOVE X U Undo all recent changes to the current line X V --- Xcount W move forward <count> Words MOVE Xcount X delete the character(s) to the left of the cursor EDIT Xcount Y yank text line(s) (copy them into a cut buffer) X Z Z save the file & exit X [ [ move back 1 section MOVE X \ --- X ] ] move forward 1 section MOVE X ^ move to the front of the current line (after indent) MOVE X _ --- X X X X X X Elvis 1.4 VISUAL MODE COMMANDS Page 2-3 X X X ` key move to a marked character MOVE Xcount a inp insert text after the cursor EDIT Xcount b move back <count> words MOVE X c mv change text EDIT X d mv delete text EDIT Xcount e move forward to the end of the current word MOVE Xcount f key move rightward to a given character MOVE X g --- Xcount h move left MOVE Xcount i inp insert text at the cursor EDIT Xcount j move down MOVE Xcount k move up MOVE Xcount l move right MOVE X m key mark a line or character X n repeat the previous search MOVE Xcount o inp open a new line below the current line EDIT X p paste text after the cursor X q --- Xcount r key replace <count> chars by a given character EDIT Xcount s inp replace <count> chars with text from the user EDIT Xcount t key move rightward *almost* to a given character MOVE X u undo the previous edit command X v --- Xcount w move forward <count> words MOVE Xcount x delete the character that the cursor's on EDIT X y mv yank text (copy it into a cut buffer) X z key scroll current line to the screen's +=top -=bottom .=middle Xcount { move back <count> paragraphs MOVE Xcount | move to column <count> (the leftmost column is 1) Xcount } move forward <count> paragraphs MOVE Xcount ~ switch a character between uppercase & lowercase EDIT X DEL --- X-------------------------------------------------------------------------------- X Xcount Many commands may be preceded by a count. This is a sequence of digits X representing a decimal number. For most commands that use a count, X the command is repeated <count> times. The count is always optional, X and usually defaults to 1. X Xkey Some commands require two keystrokes. The first key always determines X which command is to be executed. The second key is used as a parameter X to the command. X Xmv Six commands (! < > c d y) operate on text between the cursor and some X other position. To specify that other position, you are expected to X follow the command keystroke with a movement command. Also, you may X have the command operate on the whole line that the cursor is on by X typing the command key a second time. X Xinp Many commands allow the user to interactively enter text. X XEDIT These commands affect text, and may be repeated by the "." command. X XMOVE These commands move the cursor, and may be used to specify the extent X of a member of the "mv" class of commands. X X X X X X X X X Elvis 1.4 VISUAL MODE COMMANDS Page 2-4 X X X E2.1 Input ModeF X X You can't type text into your file directly from visual command X mode. Instead, you must first give a command which will put you X into input mode. The commands to do this are A/C/I/O/R/S/a/i/o/s. X X The S/s/C/c commands temporarily place a $ at the end of the X text that they are going to change. X X In input mode, all keystrokes are inserted into the text at the X cursor's position, except for the following: X X ^A insert a copy of the last input text X ^D delete one indent character X ^H (backspace) erase the character before the cursor X ^L redraw the screen X ^M (carriage return) insert a newline (^J, linefeed) X ^P insert the contents of the cut buffer X ^R redraw the screen, like ^L X ^T insert an indent character X ^U backspace to the beginning of the line X ^V insert the following keystroke, even if special X ^W backspace to the beginning of the current word X ^Z^Z write the file & exit elvis X ^[ (ESCape) exit from input mode, back to command mode X X Also, on some systems, ^S may stop output, ^Q may restart X output, and ^C may interupt execution. ^@ (the NUL character) X cannot be inserted. X X The R visual command puts you in overtype mode, which is a X slightly different form of input mode. In overtype mode, each time X you insert a character, one of the old characters is deleted from X the file. X X X E2.2 Arrow keys in Input ModeF X X The arrow keys can be used to move the cursor in input mode. X (This is an extension; the real Vi doesn't support arrow keys in X input mode.) The <PgUp>, <PgDn>, <Home>, and <End> keys work in X input mode, too. The <Delete> key deletes a single character in X input mode. X X The best thing about allowing arrow keys to work in input mode X is that as long as you're in input mode, Elvis seems to have a X fairly ordinary user interface. With most other text editors, you X are always in either insert mode or replace mode, and you can use X the arrow keys at any time to move the cursor. Now, Elvis can act X like that, too. In fact, with the new "inputmode" option and the X "control-Z control-Z" input command, you may never have to go into X visual command mode for simple edit sessions. X X X X X X X X X X X X Elvis 1.4 VISUAL MODE COMMANDS Page 2-5 X X X E2.3 DigraphsF X X Elvis supports digraphs as a way to enter non-ASCII characters. X A digraph is a character which is composed of two other X characters. For example, an apostrophe and the letter i could be X defined as a digraph which is to be stored & displayed as an X accented i. X X There is no single standard for extended ASCII character sets. X Elvis can be compiled to fill the digraph with values appropriate X for either the IBM PC character set, or the LATIN-1 character set X used by X windows, or neither. (See the discussions of -DCS_IBMPC X and -DCS_LATIN1 in the CFLAGS section of this manual.) You can view X or edit the digraph table via the ":digraph" colon command. X X Digraphs wil not be recognized until you've entered ":set X digraph". X X To actually use a digraph type the first character, then hit X <Backspace>, and then type the second character. Elvis will then X substitute the non-ASCII character in their place. X X X E2.4 AbbreviationsF X X Elvis can expand abbreviations for you. You define an X abbreviation with the :abbr command, and then whenever you type in X the abbreviated form while in input mode, elvis will immediately X the long form. COBOL programmers should find this useful. :-) X X Elvis doesn't perform the substitution until you type a X non-alphanumeric character to mark the end of the word. If you X type a control-V before that non-alphanumeric character, then Elvis X will not perform the substitution. X X X E2.5 Auto-IndentF X X With the ":set autoindent" option turned on, Elvis will X automatically insert leading whitespace at the beginning of each X new line that you type in. The leading whitespace is copied from X the preceding line. X X To add more leading whitespace, type control-T. To remove some X whitespace, type control-D. X X Elvis' autoindent mode isn't 100% compatible with vi's. In X Elvis, 0^D and ^^D don't work, ^U can wipeout all indentation, and X sometimes Elvis will use a different amount of indentation than vi X would. X X X X X X X X X X X X eof if test `wc -c <doc/visual.doc` -ne 14869 then echo doc/visual.doc damaged! fi fi if test -f doc/ex.doc -a "$1" != -f then echo Will not overwrite doc/ex.doc else echo Extracting doc/ex.doc sed 's/^X//' >doc/ex.doc <<\eof X X Elvis 1.4 COLON MODE COMMANDS Page 3-1 X X XE3. COLON MODE COMMANDSF X X -1lines command arguments -0 X [line] -1a-0ppend X -1ar-0gs [files] X -1cc-0 [files] X -1cd-0 [directory] X [line][,line] -1c-0hange X -1chd-0ir [directory] X [line][,line] -1co-0py line X [line][,line] -1d-0elete ["x] X -1di-0graph[!] [XX [Y]] X -1e-0dit[!] [file] X -1er-0rlist[!] [errlist] X -1e-0x[!] [file] X -1f-0ile [file] X [line][,line] -1g-0lobal /regexp/ command X [line] -1i-0nsert X [line][,line] -1j-0oin X [line][,line] -1l-0ist X -1mak-0e [target] X -1ma-0p[!] key mapped_to X [line] mar-1k-0 x X -1mk-0exrc X [line][,line] -1m-0ove line X -1n-0ext[!] [files] X -1N-0ext[!] X [line][,line] -1nu-0mber X -1pre-0vious[!] X [line][,line] -1p-0rint X [line] -1pu-0t ["x] X -1q-0uit[!] X [line] -1r-0ead file X -1rew-0ind[!] X -1se-0t [options] X -1so-0urce file X [line][,line] -1s-0ubstitute /regexp/replacement/[p][g][c] X -1ta-0g[!] tagname X [line][,line] -1t-0o line X -1u-0ndo X -1unm-0ap[!] key X -1ve-0rsion X [line][,line] -1v-0global /regexp/ command X -1vi-0sual X -1wq-0 X [line][,line] -1w-0rite[!] [[>>]file] X -1x-0it[!] X [line][,line] -1y-0ank ["x] X [line][,line] -1!-0 command X [line][,line] -1<-0 X [line][,line] -1=-0 X [line][,line] -1>-0 X [line][,line] -1&-0 X -1@-0 "x X X X X X X X X X X Elvis 1.4 COLON MODE COMMANDS Page 3-2 X X X To use colon mode commands, you must switch from visual command X mode to colon command mode. The visual mode commands to do this X are ":" for a single colon command, or "Q" for many colon mode X commands. X X X E3.1 Line SpecifiersF X X Line specifiers are always optional. The first line specifier X of most commands usually defaults to the current line. The second X line specifier usually defaults to be the same as the first line X specifier. Exceptions are :write, :global, and :vglobal, which act X on all lines of the file by default, and :!, which acts on no lines X by default. X X Line specifiers consist of an absolute part and a relative X part. The absolute part of a line specifier may be either an X explicit line number, a mark, a dot to denote the current line, a X dollar sign to denote the last line of the file, or a forward or X backward search. X X An explicit line number is simply a decimal number, expressed as X a string of digits. X X A mark is typed in as an apostrophe followed by a letter. Marks X must be set before they can be used. You can set a mark in visual X command mode by typing "m" and a letter, or you can set it in colon X command mode via the "mark" command. X X A forward search is typed in as a regular expression surrounded X by slash characters; searching begins at the default line. A X backward search is typed in as a regular expression surrounded by X question marks; searching begins at the line before the default X line. X X If you omit the absolute part, then the default line is used. X X The relative part of a line specifier is typed as a "+" or "-" X character followed by a decimal number. The number is added to or X subtracted from the absolute part of the line specifier to produce X the final line number. X X As a special case, the % character may be used to specify all X lines of the file. It is roughly equivelent to saying 1,$. This X can be a handy shortcut. X X Some examples: X X :p print the current line X :37p print line 37 X :'gp print the line which contains mark g X :/foo/p print the next line that contains "foo" X :$p print the last line of the file X :20,30p print lines 20 through 30 X :1,$p print all lines of the file X :%p print all lines of the file X :/foo/-2,+4p print 5 lines around the next "foo" X X X X X X X Elvis 1.4 COLON MODE COMMANDS Page 3-3 X X X E3.2 Text Entry CommandsF X X [line] append X [line][,line] change ["x] X [line] insert X X The -1a-0ppend command inserts text after the specified line. X X The -1i-0nsert command inserts text before the specified line. X X The -1c-0hange command copies the range of lines into a cut buffer, X deletes them, and inserts new text where the old text used to be. X X For all of these commands, you indicate the end of the text X you're inserting by hitting ^D or by entering a line which contains X only a period. X X X E3.3 Cut & Paste CommandsF X X [line][,line] delete ["x] X [line][,line] yank ["x] X [line] put ["x] X [line][,line] copy line X [line][,line] to line X [line][,line] move line X X The -1d-0elete command copies the specified range of lines into a X cut buffer, and then deletes them. X X The -1y-0ank command copies the specified range of lines into a cut X buffer, but does *not* delete them. X X The -1pu-0t command inserts text from a cut buffer after the X specified line. X X The -1co-0py and -1t-0o commands yank the specified range of lines and X then immediately paste them after some other line. X X The -1m-0ove command deletes the specified range of lines and then X immediately pastes them after some other line. If the destination X line comes after the deleted text, then it will be adjusted X automatically to account for the deleted lines. X X X E3.4 Display Text CommandsF X X [line][,line] print X [line][,line] list X [line][,line] number X X The -1p-0rint command displays the specified range of lines. X X The -1nu-0mber command displays the lines, with line numbers. X X X X X X X X X X Elvis 1.4 COLON MODE COMMANDS Page 3-4 X X X The -1l-0ist command also displays them, but it is careful to make X control characters visible. X X X E3.5 Global Operations CommandsF X X [line][,line] global /regexp/ command X [line][,line] vglobal /regexp/ command X X The -1g-0lobal command searches through the lines of the specified X range (or through the whole file if no range is specified) for X lines that contain a given regular expression. It then moves the X cursor to each of these lines and runs some other command on them. X X The -1v-0global command is similar, but it searches for lines that X -1don't-0 contain the regular expression. X X X E3.6 Line Editing CommandsF X X [line][,line] join X [line][,line] ! program X [line][,line] < X [line][,line] > X [line][,line] substitute /regexp/replacement/[p][g][c] X [line][,line] & X X The -1j-0oin command catenates all lines in the specified range X together to form one big line. If only a single line is specified, X then the following line is catenated onto it. X X The -1!-0 command runs an external filter program, and feeds the X specified range of lines to it's stdin. The lines are then X replaced by the output of the filter. A typical example would be X ":'a,'z!sort" to sort the lines 'a,'z. X X The -1<-0 and -1>-0 commands shift the specified range of lines left or X right, normally by the width of 1 tab character. The "shiftwidth" X option determines the shifting amount. X X The -1s-0ubstitute command finds the regular expression in each X line, and replaces it with the replacement text. The "p" option X causes the altered lines to be printed. The "g" option permits all X instances of the regular expression to be found & replaced. X (Without "g", only the first occurrence in each line is replaced.) X The "c" option asks for confirmation before each substitution. X X The -1&-0 command repeats the previous substitution command. X Actually, "&" is equivelent to "s//~/" with the same options as X last time. It searches for the last regular expression that you X specified for any purpose, and replaces it with the the same text X that was used in the previous substitution. X X X X X X X X X X X X Elvis 1.4 COLON MODE COMMANDS Page 3-5 X X X E3.7 Undo CommandF X X undo X X The -1u-0ndo command restores the file to the state it was in before X your most recent command which changed text. X X X E3.8 Configuration & Status CommandsF X X map[!] [key mapped_to] X unmap[!] key X abbr [word expanded_form_of_word] X unabbr word X digraph[!] [XX [Y]] X set [options] X mkexrc X [line] mark "x X visual X version X [line][,line] = X file [file] X source file X @ "x X X The -1ma-0p command allows you to configure Elvis to recognize your X function keys, and treat them as though they transmitted some other X sequence of characters. Normally this mapping is done only when in X the visual command mode, but with the [!] present it will map keys X under all contexts. When this command is given with no arguments, X it prints a table showing all mappings currently in effect. When X called with two arguments, the first is the sequence that your X function key really sends, and the second is the sequence that you X want Elvis to treat it as having sent. X X The -1unm-0ap command removes key definitions that were made via the X map command. X X The -1ab-0br command is used to define/list a table of X abbreviations. The table contains both the abbreviated form and X the fully spelled-out form. When you're in visual input mode, and X you type in the abbreviated form, Elvis will replace the X abbreviated form with the fully spelled-out form. When this X command is called without arguments, it lists the table; with two X or more arguments, the first argument is taken as the abbreviated X form, and the rest of the command line is the fully-spelled out X form. X X The -1una-0bbr command deletes entries from the abbr table. X X The -1di-0graph command allows you to display the set of digraphs X that Elvis is using, or add/remove a digraph. To list the set of X digraphs, use the digraph command with no arguments. To add a X digraph, you should give the digraph command two arguments. The X first argument is the two ASCII characters that are to be combined; X the second is the non-ASCII character that they represent. The X non-ASCII character's most significant bit is automatically set by X the digraph command, unless to append a ! to the command name. X X X X X X Elvis 1.4 COLON MODE COMMANDS Page 3-6 X X X Removal of a digraph is similar to adding a digraph, except that X you should leave off the second argument. X X The -1se-0t command allows you examine or set various options. With X no arguments, it displays the values of options that have been X changed. With the single argument "all" it displays the values of X all options, regardless of whether they've been explicitly set or X not. Otherwise, the arguments are treated as options to be set. X X The -1mk-0exrc command saves the current configuration to a file X called ".exrc" in the current directory. X X The mar-1k-0 command defines a named mark to refer to a specific X place in the file. This mark may be used later to specify lines X for other commands. X X The -1vi-0sual command puts the editor into visual mode. Instead of X emulating ex, Elvis will start emulating vi. X X The -1ve-0rsion command tells you that what version of Elvis this X is. X X The -1=-0 command tells you what line you specified, or, if you X specified a range of lines, it will tell you both endpoints and the X number of lines included in the range. X X The -1f-0ile command tells you the name of the file, whether it has X been modified, the number of lines in the file, and the current X line number. You can also use it to change the name of the current X file. X X The -1so-0urce command reads a sequence of colon mode commands from X a file, and interprets them. X X The -1@-0 command executes the contents of a cut-buffer as EX X commands. X X X E3.9 Multiple File CommandsF X X args [files] X next[!] [files] X Next[!] X previous[!] X rewind[!] X X When you invoke Elvis from your shell's command line, any X filenames that you give to Elvis as arguments are stored in the X args list. The -1ar-0gs command will display this list, or define a X new one. X X The -1n-0ext command switches from the current file to the next one X in the args list. You may specify a new args list here, too. X X The -1N-0ext and -1pre-0vious commands (they're really aliases for the X same command) switch from the current file to the preceding file in X the args list. X X X X X X X Elvis 1.4 COLON MODE COMMANDS Page 3-7 X X X The -1rew-0ind command switches from the current file to the first X file in the args list. X X X E3.10 Switching FilesF X X edit[!] [file] X tag[!] tagname X X The -1e-0dit command allows to switch from the current file to some X other file. This has nothing to do with the args list, by the X way. X X The -1ta-0g command looks up a given tagname in a file called X "tags". This tells it which file the tag is in, and how to find it X in that file. Elvis then switches to the tag's file and finds the X tag. X X X E3.11 Working with a CompilerF X X cc [files] X make [target] X errlist[!] [errlist] X X The -1cc-0 and -1mak-0e commands execute your compiler or "make" utility X and redirect any error messages into a file called "errlist". By X default, cc is run on the current file. (You should write it X before running cc.) The contents of the "errlist" file are then X scanned for error messages. If an error message is found, then the X cursor is moved to the line where the error was detected, and the X description of the error is displayed on the status line. X X After you've fixed one error, the -1er-0rlist command will move the X cursor to the next error. In visual command mode, hitting `*' will X do this, too. X X You can also create an "errlist" file from outside of Elvis, and X use "elvis -m" to start elvis and have the cursor moved to the X first error. Note that you don't need to supply a filename with X "elvis -m" because the error messages always say which source file X an error is in. X X Note: When you use errlist repeatedly to fix several errors in a X single file, it will attempt to adjust the reported line numbers to X allow for lines that you have inserted or deleted. These X adjustments are made with the assumption that you will work though X the file from the beginning to the end. X X X E3.12 Exit CommandsF X X quit[!] X wq X xit X X X X X X X X X Elvis 1.4 COLON MODE COMMANDS Page 3-8 X X X The -1q-0uit command exits from the editor without saving your X file. X X The -1wq-0 command writes your file out, then then exits. X X The -1x-0it command is similar to the -1wq-0 command, except that -1x-0it X won't bother to write your file if you haven't modified it. X X X E3.13 File I/O CommandsF X X [line] read file X [line][,line] write[!] [[>>]file] X X The -1r-0ead command gets text from another file and inserts it X after the specified line. It can also read the output of a X program; simply precede the program name by a '!' and use it in X place of the file name. X X The -1w-0rite command writes the whole file, or just part of it, to X some other file. The !, if present, will permit the lines to be X written even if you've set the readonly option. If you precede the X filename by >> then the lines will be appended to the file. X X X E3.14 Directory CommandsF X X cd [directory] X chdir [directory] X shell X X The -1cd-0 and -1chd-0ir commands (really two names for one command) X switch the current working directory. X X The -1sh-0ell command starts an interactive shell. X X X E3.15 Debugging CommandsF X X [line][,line] debug[!] X validate[!] X X These commands are only available if you compile Elvis with the X -DDEBUG flag. X X The de-1b-0ug command lists statistics for the blocks which contain X the specified range of lines. If the ! is present, then the X contents of those blocks is displayed, too. X X The -1va-0lidate command checks certain variables for internal X consistency. Normally it doesn't output anything unless it detects X a problem. With the !, though, it will always produce *some* X output. X X X X X X X X X eof if test `wc -c <doc/ex.doc` -ne 19254 then echo doc/ex.doc damaged! fi fi if test -f doc/versions.doc -a "$1" != -f then echo Will not overwrite doc/versions.doc else echo Extracting doc/versions.doc sed 's/^X//' >doc/versions.doc <<\eof X X Elvis 1.4 VERSIONS Page 12-1 X X XE12. VERSIONSF X X Elvis currently works under BSD UNIX, AT&T System-V UNIX, SCO X XENIX, Minix, Coherent, MS-DOS, Atari TOS, and OS9/68k. This X section of the manual provides special information that applies to X each particular version of Elvis. X X For all versions except MS-DOS, the file "Makefile.mix" should X be copied to "Makefile", and then edited to select the correct set X of options for your system. There is more information about this X embedded in the file itself. X X X E12.1 BSD UNIXF X X Temporary files are stored in /tmp. X X Elvis doesn't have an "expreserve" program yet. Instead, you X should modify /etc/rc so that the temp files are not deleted when X the system is rebooted. Find a line in /etc/rc which reads X X rm -rf /tmp/* X X or something like that, and change it to read X X rm -rf /tmp/[^e]* /tmp/e[^l]* /tmp/el[^v]* /tmp/elv_* X X If you do not have permission to modify /etc/rc, don't fret. X The above modification is only needed to allow you to recover your X changes after a system crash. You can still run Elvis without that X modification, and you can still recover your changes when Elvis X crashes or when your dialup modem looses the carrier signal, or X something like that. A system crash is the only thing that could X hurt you. X X Both Elvis and the real Vi read initialization commands from a X file called ".exrc", but the commands in that file might work on X one but not the other. For example, "set keywordprg=man" will work X for Elvis, but Vi will complain because it doesn't have a X "keywordprg" option. If the warning messages annoy you, then you X can edit the config.h file to change the name of the initialization X file ".exrc" to something else, such as ".elvisrc". X X If you use X windows, you may wish to add "-DCS_LATIN1" to X CFLAGS. This will cause the digraph table and the flipcase option X to have default values that are appropriate for the LATIN-1 X character set. That's the standard character set for X. X X X E12.2 System-V UNIXF X X If your system uses terminfo instead of termcap, then you will X have to edit the LIBS setting in the Makefile. Currently it says X "LIBS=-ltermcap", but you may have to change it to X "LIBS=-lterminfo" or "LIBS=-lterm" or something like that. X X X X X X X X X Elvis 1.4 VERSIONS Page 12-2 X X X The /etc/rc file should be modified as described for BSD X systems, above. The potential trouble with ".exrc" described above X for BSD UNIX applies to System-V UNIX as well. X X Elvis uses control-C as the interrupt key, not Delete. X X X E12.3 SCO XenixF X X For Xenix-386, you can use the generic System-V settings. You X may wish to add "-DCS_IBMPC" to CFLAGS, to have the digraph table X and flipcase option start up in a mode that is appropriate for the X console. X There is a separate group of settings for use with Xenix-286. It X already has "-DCS_IBMPC" in CFLAGS. X X Because Xenix is so similar to System-V, everything I said X earlier about System-V applies to the Xenix version too. X X X E12.4 MinixF X X There are separate settings in Makefile.mix for Minix-PC and X Minix-ST. The differences between these two are that the ST X version uses ".o" for the object file extension where the PC X version uses ".s", and the PC version has some extra flags in X CFLAGS to reduce the size of Elvis. The PC version also uses X tinytcap (instead of the full termcap) to make it smaller. X X Minix-PC users should read the CFLAGS section of this manual X very carefully. You have some choices to make... X X The temporary files are stored in /usr/tmp. The /usr/tmp X directory must exist before you run Elvis, and it must be X readable/writable by everybody. We use /usr/tmp instead of /tmp X because after a system crash or power failure, you can recover the X altered version of a file from the temporary file in /usr/tmp. If X it was stored in /tmp, though, then it would be lost because /tmp X is probably located on the RAM disk. X X Elvis uses control-C as the interrupt key, not Delete. X X X E12.5 CoherentF X X Elvis was ported to Coherent by Esa Ahola. X X Elvis is too large to run under Coherent unless you eliminate X some features via the CFLAGS setting. The recommended settings, in X Makefile.mix, produce a working version of elvis which emulates Vi X faithfully, but lacks most of the extensions. You should read the X CFLAGS section of this manual carefully. X X You can probably reduce the size of Elvis by using tinytcap.c X instead of -lterm. This would allow you to keep most features of X Elvis, at the expense of terminal independence. (Tinytcap.c has X ANSI escape sequences hard-coded into it.) To use tinytcap, just X add "tinytcap.o" to the "EXTRA=" line in the Makefile, and remove X X X X X X Elvis 1.4 VERSIONS Page 12-3 X X X "-lterm" from the "LIBS=" line. X X The temporary files are stored in /tmp. You should modify your X /etc/rc file as described for BSD earlier. X X X E12.6 MS-DOSF X X Elvis was ported to MS-DOS by Guntram Blohm and Martin Patzel. X Dave Lord also deserves a big "thank you" for exploring a X compatibility glitch between DOS 4.01 and Elvis. X X Ideally, Elvis should be compiled with Microsoft C 5.1 and the X standard Microsoft Make utility, via the command "make elvis.mak". X This will compile Elvis and all related utilities. X X If you have Turbo-C, then you can 4almost5 use the "Elvis.prj" X file to compile Elvis. EYou must explicitly force Turbo-C to X compile it with the "medium" memoryF Emodel, and you must increase X the stack size to 16k.F Most of the related programs (ctags, ref, X virec, refont, and wildcard) are only one file long, so you should X have no trouble compiling them. The "alias.c" file is meant to be X compiled once into an executable named "ex.exe". You should then X copy "ex.exe" to "vi.exe", and "view.exe". X X Elvis stores its temporary files in C:\tmp. If this is not X satisfactory, then you should edit the CFLAGS line of your Makefile X to change TMPDIR to something else before compiling. You can also X control the name of the temp directory via an environment variable X named TMP or TEMP. The directory must exist before you can run X Elvis. X X Normally, the TERM environment variable should not be set, or X else it should be set to "pcbios". This way, Elvis will make calls X to BIOS to update the screen. (If you don't like the colors that X the BIOS interface uses, then edit the attr[] table in pc.c. A X ":color" command will be added eventually.) X X You may prefer to use a device driver such as ANSI.SYS or X NNANSI.SYS, for speed; or you may NEED to use a device driver for X compatibility. If so, you should install one of these drivers by X adding "driver = ansi.sys" (or whatever) to your CONFIG.SYS file, X and then you should define TERM to be either "ansi" or "nansi" by X adding a line such as "set TERM=ansi" to your AUTOEXEC.BAT file. X You must then reboot for these changes to take effect. After that, X Elvis will notice the "TERM" setting and use the driver. X X Under MS-DOS, Elvis has an extra ":set" option called "pcbios" X which indicates whether the BIOS is being used directly. This is a X "read only" option; you can't use it to switch your interface style X in the middle of an edit session. X X An extra program, called "wildcard", is needed for MS-DOS. It X expands wildcard characters in file names. X X X X X X X X X X Elvis 1.4 VERSIONS Page 12-4 X X X E12.7 Atari TOSF X X Elvis was ported to Atari TOS by Guntram Blohm and Martin X Patzel. It is very similar to the MS-DOS version. It has only X been tested with the Mark Williams C compiler. X X The TERM environment variable is ignored; the ST port always X assumes that TERM=vt52. The SHELL (not COMSPEC!) variable should X be set to the name of a line-oriented shell. X X A simple shell in included with elvis. Its source is in X "shell.c", and the name of the executable is "shell.ttp". This was X necessary because the standard Atari software doesn't offer any way X to set environment variables. The file "profile.sh" should contain X a set of instructions to be executed when the shell first starts X up. An example of this file is included, but you will almost X certainly want to edit it right away to match your configuration. X X If you already have a command-line shell, then you'll probably X want to continue using it. The shell that comes with Elvis is very X limited. X X Currently, character attributes cannot be displayed on the X screen. In other words, the "charattr" option doesn't work very X well. Its ironic -- the only system that always has a bitmapped X display is the only system that doesn't support multiple fonts! X X X E12.8 OS9/68kF X X Elvis was ported to OS9/68k by Peter Reinig. X X The Makefile is currently configured to install elvis and the X related programs in /dd/usr/cmds If this this is unacceptable, then X you should change the BIN setting to some other directory. X Similarly, it expects the source code to reside in X /dd/usr/src/elvis; the ODIR setting is used to control this. X X Temporary files are stored in the /dd/tmp directory. Your X /dd/startup file may need to be modified to prevent it from X deleting Elvis' temporary files. X X The program in alias.c is linked repeatedly to produce the "vi", X "view", and "input" aliases for elvis. Sadly, the "ex" alias is X impossible to implement under OS9, because the shell has a built-in X command by that name. X X For some purposes, you must give `make' the "-b" option. X Specifically, you need this for "make -b clean" and "make -b X install". X X X X X X X X X X X X eof if test `wc -c <doc/versions.doc` -ne 10854 then echo doc/versions.doc damaged! fi fi if test -f doc/cflags.doc -a "$1" != -f then echo Will not overwrite doc/cflags.doc else echo Extracting doc/cflags.doc sed 's/^X//' >doc/cflags.doc <<\eof X X Elvis 1.4 CFLAGS Page 9-1 X X XE9. CFLAGSF X X Elvis uses many preprocessor symbols to control compilation. X Some of these control the sizes of buffers and such. The X "-DNO_XXXX" options remove small sets of related features. X X Most Elvis users will probably want to keep all features X available. Minix-PC users, though, will have to sacrifice some X sets because otherwise Elvis would be too bulky to compile. The X "asld" phase of the compiler craps out. X X -DM_SYSV, -DTOS, -DCOHERENT X These flags tell the compiler that Elvis is being compiled X for System-V UNIX, Atari TOS, or Coherent, respectively. X For other systems, the config.h file can generally figure it X out automatically. X X -DDATE=4string5 X DATE should be defined to be a string constant. It is X printed by the :version command as the compilation date of X the program. X X It is only used in cmd1.c, and even there you may leave it X undefined without causing an urp. X X -DNBUFS=4number5 X Elvis keeps most of your text in a temporary file; only a X small amount is actually stored in RAM. This flag allows X you to control how much of the file can be in RAM at any X time. The default is 5 blocks. (See the -DBLKSIZE flag, X below.) X X More RAM allows global changes to happen a little faster. X If you're just making many small changes in one section of a X file, though, extra RAM won't help much. X X -DBLKSIZE=4number5 X This controls the size of blocks that Elvis uses X internally. The value of BLKSIZE must be a power of two. X The default value is 1024, which allows you to edit files up X to almost 512K bytes long. Every time you double BLKSIZE, X you quadruple the size of a text file that Elvis can handle, X but you also cause the temporary file to grow faster. X X -DTMPDIR=4string5 X This sets the default value of the "directory" option, which X specifies where the temporary files should reside. The X value of TMPDIR must be a string, so be sure your value X includes the quote characters on each end. X X -DEXRC=4str5, -DHMEXRC=4str5, -DSYSEXRC=4str5, -DEXINIT=4str5 X This lets you control the names of the initialization X files. Their values must be strings, so be careful about X quoting. X X X X X X X X X X Elvis 1.4 CFLAGS Page 9-2 X X X EXRC is the name of the initialization file in the current X directory. Its default value is ".exrc" on UNIX systems -- X the same as the real vi. For other systems, check the X config.h file. X X HMEXRC is the name of the initialization file in your home X directory. By default, it is the same as EXRC. Elvis will X automatically prepend the name of your home directory to X HMEXRC at run time, so don't give a full path name. X X SYSEXRC is the name of a system-wide initialization file. X It has no default value; if you don't define a value for it, X then the code that supports SYSEXRC just isn't compiled. X The value of SYSEXRC should be a full pathname, in quotes. X X EXINIT is the name of an environment variable that can X contain initialization commands. Normally, its value is X "EXINIT". X X -DKEYWORDPRG=4string5 X This flag determines the default value of the "keywordprg" X option. Its value must be a string, so be careful about X quoting. The default value of this flag is "ref", which is X a C reference program. X X -DCC_COMMAND=4string5 -DMAKE_COMMAND=4string5 -DERRLIST=4string5 X These control the names of the C compiler, the "make" X utility, and the error output file, respectively. They are X only used if -DNO_ERRLIST is not given. X X -DMAXMAPS=4number5 X This controls the capacity of the key map table. X X -DMAXRCLEN=4number5 X This determines how large a .exrc file can be (measured in X bytes). The default is 1000 bytes. If you increase this X value significantly, then you may need to allocate extra X memory for the stack. See the "CHMEM" setting in the X Makefile. X X -DSHELL=4string5 X This is the default value of the "shell" option, and hence X the default shell used from within Elvis. This only X controls the default; the value you give here may be X overridden at run-time by setting an environment variable X named SHELL (or COMSPEC for MS-DOS). Its value must be a X string constant, so be careful about quoting. X X -DTAGS=4string5 X This sets the name of the "tags" file, which is used by the X :tag command. Its value must be a string constant, so be X careful about quoting. X X -DCS_IBMPC X The digraph table and flipcase option will normally start X out empty. However, if you add -DCS_IBMPC or -DCS_LATIN1 to X your CFLAGS, then they will start out filled with values X that are appropriate for the IBM PC character set or the ISO X X X X X X Elvis 1.4 CFLAGS Page 9-3 X X X Latin-1 character set, respectively. X X -DDEBUG X This adds the ":debug" and ":validate" commands, and also X adds many internal consistency checks. It increases the X size of the ".text" segment by about 6K. X X -DCRUNCH X This flag removes some non-critical code, so that Elvis is X smaller. For example, it removes a short-cut from the X regexp package, so that text searches are slower. Also, X screen updates are not as efficient. A couple of obscure X features are disabled by this, too. X X -DNO_MKEXRC X This removes the ":mkexrc" command, so you have to create X any .exrc files manually. The size of the .text segment X will be reduced by about 600 bytes. X X -DNO_CHARATTR X Permanently disables the charattr option. This reduces the X size of your ".text" segment by about 850 bytes. X X -DNO_RECYCLE X Normally, Elvis will recycle space (from the tmp file) which X contains totally obsolete text. This flag disables this X recycling. Without recycling, the ".text" segment is about X 1K smaller than it would otherwise be, but the tmp file X grows much faster. If you have a lot of free space on your X harddisk, but Elvis is too bulky to run with recycling, then X try it without recycling. X X When using a version of Elvis that has been compiled with X -DNO_RECYCLE, you should be careful to avoid making many X small changes to a file because each individual change will X cause the tmp file to grow by at least 1k. Hitting "x" X thirty times counts as thirty changes, but typing "30x" X counts as one change. Also, you should occasionally do a X ":w" followed by a ":e" to start with a fresh tmp file. X X -DNO_SENTENCE X Leaves out the "(" and ")" visual mode commands. Also, the X "[[", "]]", "{", and "}" commands will not recognize *roff X macros. The sections and paragraphs options go away. This X saves about 650 bytes in the ".text" segment. X X -DNO_CHARSEARCH X Leaves out the visual commands which locate a given X character in the current line: "f", "t", "F", "T", "," and X ";". This saves about 900 bytes. X X -DNO_EXTENSIONS X Leaves out the "K" and "#" visual commands. Also, the arrow X keys will no longer work in input mode. (Other extensions X are either inherent in the design of elvis, or are X controlled by more specific flags, or are too tiny to be X worth removing.) This saves about 250 bytes. X X X X X X X Elvis 1.4 CFLAGS Page 9-4 X X X -DNO_MAGIC X Permanently disables the "magic" option, so that most X meta-characters in a regular expression are *NOT* X recognized. This saves about 3k of space in the ".text" X segment, because the complex regular expression code can be X replaced by much simpler code. X X -DNO_SHOWMODE X Permanently disables the "showmode" option, saving about 250 X bytes. X X -DNO_CURSORSHAPE X Normally, Elvis tries to adjust the shape of the cursor as a X reminder of which mode you're in. The -DNO_CURSORSHAPE flag X disables this, saving about 150 bytes. X X -DNO_DIGRAPH X To allow entry of non-ASCII characters, Elvis supports X digraphs. A digraph is a single (non-ASCII) character which X is entered as a combination of two other (ASCII) X characters. If you don't need to input non-ASCII X characters, or if your keyboard supports a better way of X entering non-ASCII characters, then you can disable the X digraph code and save about 450 bytes. X X -DNO_ERRLIST X Elvis adds a ":errlist" command, which is useful to X programmers. If you don't need this feature, you can X disable it via the -DNO_ERRLIST flag. This will reduce the X .text segment by about 900 bytes, and the .bss segment by X about 300 bytes. X X -DNO_ABBR X The -DNO_ABBR flag disables the ":abbr" command, and reduces X the size of Elvis by about 600 bytes. X X -DNO_OPTCOLS X When Elvis displays the current options settings via the X ":set" command, the options are normally sorted into X columns. The -DNO_OPTCOLS flag causes the options to be X sorted across the rows, which is much simpler. The X -DNO_OPTCOLS flag will reduce the size of your .text segment X by about 500 bytes. X X -DNO_MODELINE X This removes all support for modelines. X X X X X X X X X X X X X X X X eof if test `wc -c <doc/cflags.doc` -ne 11052 then echo doc/cflags.doc damaged! fi fi if test -f doc/differ.doc -a "$1" != -f then echo Will not overwrite doc/differ.doc else echo Extracting doc/differ.doc sed 's/^X//' >doc/differ.doc <<\eof X X Elvis 1.4 DIFFERENCES BETWEEN ELVIS & BSD VI/EX Page 7-1 X X XE7. DIFFERENCES BETWEEN ELVIS & BSD VI/EXF X X X E7.1 ExtensionsF X X :mkexrc X :mk X X This EX command saves the current :set and :map configurations X in the ".exrc" file in your current directory. X X :Next X :previous X :N X :pre X X These commands move backwards through the args list. X X zz X X In visual command mode, the (lowercase) "zz" command will center X the current line on the screen, like "z=". X X . X X The default count value for . is the same as the previous X command which . is meant to repeat. However, you can supply a new X count if you wish. For example, after "3dw", "." will delete 3 X words, but "5." will delete 5 words. X X ". X X The text which was most recently input (via a "cw" command, or X something similar) is saved in a cut buffer called ". (which is a X pretty hard name to write in an English sentence). X X K X X In visual command mode, you can move the cursor onto a word and X press shift-K to have Elvis run a reference program to look that X word up. This command alone is worth the price of admission! See X the ctags and ref programs. X X # X X In visual command mode, you can move the cursor onto a number X and then hit ## or #+ to increment that number by 1. To increment X it by a larger amount, type in the increment value before hitting X the initial #. The number can also be decremented or set by X hitting #- or #=, respectively. X X input X X You can backspace past the beginning of the line. X X X X X X X X X X Elvis 1.4 DIFFERENCES BETWEEN ELVIS & BSD VI/EX Page 7-2 X X X The arrow keys work in input mode. X X If you type control-A, then the text that you input last time is X inserted. You will remain in input mode, so you can backspace over X part of it, or add more to it. (This is sort of like control-@ on X the real vi, except that control-A really works.) X X Control-P will insert the contents of the cut buffer. X X Real vi can only remember up to 128 characters of input, but X Elvis can remember any amount. X X The ^T and ^D keys can adjust the indent of a line no matter X where the cursor happens to be in that line. X X You can save your file and exit Elvis directly from input mode X by hitting control-Z twice. X X Elvis supports digraphs as a way to enter non-ASCII characters. X X :set inputmode X :se im X X If you set this flag in your .exrc file, then elvis will start X up in input mode instead of visual command mode. X X :set charattr X :se ca X X Elvis can display "backslash-f" style character attributes on X the screen as you edit. The following example shows the recognized X atributes: X X normal \fBboldface\fR \fIitalics\fR \fUunderlined\fR normal X X NOTE: you must compile elvis without the -DNO_CHARATTR flag for X this to work. X X :set sync X :se sy X X After a crash, you can usually recover the altered form of the X file from the temporary file that Elvis uses. With the sync option X turned on, the odds are shifted a little more in your favor because X Elvis will perform a sync() call after each change has been written X to the temporary file. X X cursor shape X X Elvis changes the shape of the cursor to indicate which mode X you're in, if your terminal's termcap entry includes the necessary X capabilities. X X :set hideformat X :se hf X X X X X X X X X Elvis 1.4 DIFFERENCES BETWEEN ELVIS & BSD VI/EX Page 7-3 X X X This option hides format control lines. (They are displayed on X the screen as blank lines.) X X :errlist X * X elvis -m X X Elvis is clever enough to parse the error messages emitted by X many compilers. To use this feature, you should collect your X compiler's error messages into a file called "errlist"; elvis will X read this file, determine which source file caused the error X messages, start editing that file, move the cursor to the line X where the error was detected, and display the error message on the X status line. Nifty! X X X E7.2 OmissionsF X X The replace mode is a hack. It doesn't save the text that it X overwrites. X X Long lines are displayed differently -- where the real vi would X wrap a long line onto several rows of the screen, Elvis simply X displays part of the line, and allows you to scroll the screen X sideways to see the rest of it. X X The ":preserve" and ":recover" commands are missing. So is the X -r flag. I've never had a good reason to use ":preserve", and X since ":recover" is used so rarely I decided to implement it as a X separate program. There's no need to load the recovery code into X memory every time you edit a file, I figured. X X LISP support is missing. X X Due to naming conventions used for the temporary files, Elvis X can be creating no more that one new file per directory at any X given time. Any number of existing files can be edited at the same X time on multitasking computer systems, but only one new file can be X created simultaneously per directory. To relieve this problem, you X would have to edit tmp.c and virec.c This is expected to be done in X version 1.5 X X Autoindent mode acts a little different from the real vi. It is X still quite useful, but if you frequently use both vi and elvis X then the differences may be annoying. Autoindent is -1gradually-0 X improving. X X The visual "put" command cannot be repeated by hitting the . X key. X X X X X X X X X X X X X eof if test `wc -c <doc/differ.doc` -ne 5908 then echo doc/differ.doc damaged! fi fi exit 0 ------------------------------------------------------------------------------- Steve Kirkendall kirkenda@cs.pdx.edu Grad student at Portland State U.