Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 63353867f2
Fetching contributors…

Cannot retrieve contributors at this time

file 482 lines (482 sloc) 20.489 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482
\*E currently works under BSD UNIX, AT&T System-V UNIX, SCO XENIX,
Minix, Coherent, MS-DOS, Atari TOS, OS9/68k, VAX/VMS, AmigaDos, and OS/2.
This section of the manual provides special information that applies to each
particular version of \*E.
For all versions except MS-DOS and VMS,
the file "Makefile.mix" should be copied to "Makefile",
and then edited to select the correct set of options for your system.
There is more information about this embedded in the file itself.
.NH 2
Temporary files are stored in /tmp.
You should modify /etc/rc so that
the temp files are preserved when the system is rebooted.
Find a line in /etc/rc which reads
.ti +0.5i
ex4.3preserve /tmp
or something like that, and append the following line:
.ti +0.5i
elvprsv /tmp/elv*
If you do not have permission to modify /etc/rc, don't fret.
The above modification is only needed to allow you to recover your changes
after a system crash.
You can still run \*E without that modification,
and you can still recover your changes when \*E crashes
or when your dialup modem looses the carrier signal, or something like that.
Only a system crash or power failure could hurt you.
Both \*E and the real Vi
read initialization commands from a file called ".exrc",
but the commands in that file might work on one editor but not the other.
For example, "set keywordprg=man" will work for \*E,
but Vi will complain because it doesn't have a "keywordprg" option.
If the warning messages annoy you, then you can edit the CFLAGS setting
in the Makefile and add -DEXRC=\\".elvisrc\\".
If you use X windows, you may wish to add "-DCS_LATIN1" to CFLAGS.
This will cause the digraph table and the flipcase option to have default
values that are appropriate for the LATIN-1 character set.
That's the standard character set for X.
The default mailer used notify users when text is preserver is "mail".
You may wish to change this to "Mail" (with an uppercase 'M').
See the description of "MAILER" in the CFLAGS section of this manual.
The default keyboard macro time-out value is larger for BSD than it is for
some other systems, because I've had trouble running \*E via rlogin or Xterm.
I guess it takes a while for those keystokes to squirt through the net.
.NH 2
System-V UNIX
Most SysV UNIX systems use terminfo instead of termcap,
but the terminfo library doesn't seem to have a standard name.
As shipped, \*E' Makefile.mix is configured with "LIBS=-ltermcap".
You may need to change it to "LIBS=-lterm" or "LIBS=-lterminfo"
or even "LIBS=-lcurses".
The /etc/rc file (or its equivalent) should be modified as described
for BSD systems, above.
There's a pretty good chance that "make install" will do this for you;
it knows how to create an editor recovery file in the /etc/rc2.d directory,
which is where most modern SysV systems store initialization commands.
You only need to do it manually for older SysV systems.
The potential trouble with ".exrc" described above for BSD UNIX applies
to System-V UNIX as well.
The default mailer used notify users when text is preserver is "mail".
You may wish to change this to "mailx".
See the description of "MAILER" in the CFLAGS section of this manual.
\*E uses control-C as the interrupt key, not Delete.
This was done so that the <Del> key could be used for character deletion.
.NH 2
SCO Xenix
For Xenix-386, you can use the generic System-V settings.
You may wish to add "-DCS_IBMPC" to CFLAGS, to have the digraph table and
flipcase option start up in a mode that is appropriate for the console.
Also, note that there is a separate group of settings for use with Xenix-286.
It already has "-DCS_IBMPC" in CFLAGS.
Because Xenix is so similar to System-V, everything I said earlier about
System-V applies to the Xenix version too, except that editor recovery
might belong in a directory called /etc/rc.d/8 instead.
.NH 2
There are separate settings in Makefile.mix for Minix-PC and Minix-68k.
The differences between these two are that
the 68k version uses ".o" for the object file extension where
the PC version uses ".s", and
the PC version has some extra flags in CFLAGS to reduce the size of \*E.
The PC version also uses tinytcap (instead of the full termcap)
to make it smaller.
Minix-PC users should read the CFLAGS section of this manual very carefully.
You have some choices to make...
The temporary files are stored in /usr/tmp.
The /usr/tmp directory must exist before you run \*E,
and it must be readable & writable by everybody.
We use /usr/tmp instead of /tmp because
after a system crash or power failure,
you can recover the altered version of a file from the temporary file
in /usr/tmp.
If it was stored in /tmp, though, then it would be lost because /tmp is
normally located on the RAM disk.
Also, you'll need a /usr/preserve directory which is readable & writable
by root;
this directory is used to store text files that have been preserved after a
The "make install" script will create it if necessary.
\*E uses control-C as the interrupt key, not Delete.
.NH 2
\*E was ported to Coherent by Esa Ahola.
\*E is too large to run under Coherent unless you eliminate some
features via the CFLAGS setting.
The recommended settings, in Makefile.mix, produce a working version
of \*E which emulates Vi faithfully, but lacks most of the extensions.
You should read the CFLAGS section of this manual carefully.
You can probably reduce the size of \*E by using tinytcap.c instead of -lterm.
This would allow you to keep most features of \*E,
at the expense of terminal independence.
(Tinytcap.c has ANSI escape sequences hard-coded into it.)
To use tinytcap, just add "tinytcap.o" to the "EXTRA=" line in the Makefile,
and remove "-lterm" from the "LIBS=" line.
The temporary files are stored in /tmp.
Preserved files are stored in /usr/preserve.
You should modify your /etc/rc file to support file preservation;
add the line ...
/usr/bin/elvprsv /tmp/*
 ... just before the first "/bin/rm" line.
.NH 2
The Makefile.mix file has a special section of options for Linux.
There should be no surprises.
Linux is mostly SysV-ish, so the SysV comments above will apply to Linux
as well, except that most Linux systems still have an old-style /etc/rc file.
You should add the command ...
/usr/bin/elvprsv /tmp/*
 ... in there somewhere.
On my SLS 1.02 system, I added it near the end, just before the line that
runs the shell on "/etc/rc.local".
.NH 2
\*E was ported to MS-DOS by Guntram Blohm and Martin Patzel.
Willett Kempton added support for the DEC Rainbow.
Ideally, \*E should be compiled with Microsoft C 5.10 and the standard
Microsoft Make utility,
via the command "make elvis.mak".
This will compile \*E and all related utilities.
With Microsoft C 6.00, you may have trouble compiling regexp.c.
If so, try compiling it without optimization.
The "Makefile.mix" file contains a set of suggested settings for compiling
\*E with Turbo-C or Borland C.
(If you have Turbo-C, but not the Make utility,
then you can \fIalmost\fR use the "\*E.prj" file to compile \*E,
but you must explicitly force Turbo-C to compile it with the "medium" memory model.
Most of the related programs [ctags, ref, virec, refont, and wildcard] are
only one file long, so you should have no trouble compiling them.)
The "alias.c" file is meant to be compiled once into an executable named
You should then copy "ex.exe" to "vi.exe" and "view.exe".
\*E stores its temporary files in C:\\tmp.
If this is not satisfactory, then you should edit the CFLAGS line of
your Makefile to change TMPDIR to something else before compiling.
You can also control the name of the temp directory via an environment
variable named TMP or TEMP.
The directory must exist before you can run \*E.
The TERM environment variable determines how \*E will write to the screen.
It can be set to any one of the following values:
.ta 1.5i 2.5i
pcbios Use BIOS calls on an IBM-PC clone.
rainbow Use DEC Rainbow interface.
ansi Use ANSI.SYS driver.
nansi User faster NANSI.SYS driver.
If the TERM variable isn't set, then \*E will automatically select either
the "rainbow" interface (when run on a Rainbow) or "pcbios" (on an IBM clone).
You may prefer to use NANSI.SYS for speed;
or you may NEED to use ANSI.SYS for a non-clone, such as a lap-top.
If so, you should
install one of these drivers by adding "driver = nansi.sys" (or whatever)
to your CONFIG.SYS file,
and then you should define TERM to be "nansi" (or whatever) by adding
"set TERM=nansi" to your AUTOEXEC.BAT file.
You must then reboot for these changes to take effect.
After that, \*E will notice the "TERM" setting and use the driver.
Since ".exrc" is not a valid DOS filename,
the name of the initialization file has been changed to "elvis.rc".
\*E will look for an "elvis.rc" file first in your home directory.
If it exists, and contains ":set exrc", then \*E will check for
another "elvis.rc" in the current directory.
By default, the directory where ELVIS.EXE resides is taken to be your
home directory.
You can override this default by setting an environment variable named
"HOME" to the full pathname of your home directory.
To set "HOME", you would typically add the following line to your
.ti +0.5i
set HOME c:\\
An extra program, called "wildcard", is needed for MS-DOS.
It expands wildcard characters in file names.
If \*E flashes a "Bad command or filename" message when it starts,
then you've probably lost the WILDCARD.EXE program somehow.
\*E can run under Windows, but you may have trouble with TEMP.
Windows uses an environment variable called TEMP which interferes with
\*E' usage of TEMP;
to work around this, you can simply set an environment variable named
TMP (with no 'E') to the name of \*E' temporary directory.
When TEMP and TMP are both set, \*E uses TMP and ignored TEMP.
In a ":set" command, the backslash character is used to "escape" the
character that follows it.
To make a backslash be part of a string option's value,
you must enter a double backslash.
For example, to define the directory where temporary files will exist,
you could add ":set dir=C:\\\\tmp" to your ELVIS.RC file.
Just plain ":set dir=C:\\tmp" (with one backslash) \fIwon't work!\fR.
.NH 2
Atari TOS
\*E was ported to Atari TOS by Guntram Blohm and Martin Patzel.
It is very similar to the MS-DOS version.
It has been tested with the Mark Williams C compiler and also GNU-C.
The TERM environment variable is ignored;
the ST port always assumes that TERM=vt52.
The SHELL (not COMSPEC!) variable should be set to
the name of a line-oriented shell.
A simple shell in included with \*E.
Its source is in "shell.c", and the name of the executable is "shell.ttp".
The file "" should contain a set of instructions to be executed
when the shell first starts up.
An example of this file is included, but you will almost certainly want to
edit it right away to match your configuration.
(If you already have a command-line shell,
then you'll probably want to continue using it.
The shell that comes with \*E is very limited.)
Currently, character attributes cannot be displayed on the screen.
\*E runs under MiNT (a free multi-tasking extension to TOS)
but it can be a CPU hog because of the way that \*E reads from the
keyboard with timeout.
Also, \*E doesn't use any of the special features of MiNT.
I have received a set of patches that optimize \*E for MiNT,
but they arrived too late to integrate into this release.
.NH 2
\*E was ported to OS9/68k by Peter Reinig.
The Makefile is currently configured to install \*E and the related
programs in /dd/usr/cmds
If this this is unacceptable, then you should change the BIN setting
to some other directory.
Similarly, it expects the source code to reside in /dd/usr/src/elvis;
the ODIR setting is used to control this.
Temporary files are stored in the /dd/tmp directory.
Your /dd/startup file may need to be modified
to prevent it from deleting \*E' temporary files;
make /dd/startup run the \fIelvprsv\fR program before it wipes out /dd/tmp.
The program in alias.c is linked repeatedly to produce the
"vi", "view", and "input" aliases for \*E.
Sadly, the "ex" alias is impossible to implement under OS9
because the shell has a built-in command by that name.
For some purposes,
you must give `make' the "-b" option.
Specifically, you need this for "make -b clean" and "make -b install".
.NH 2
John Campbell ported \*E to VAX/VMS.
A heavily laden VAX can take half an hour to compile \*E.
This is normal.
Don't panic.
While running, \*E will create temporary files in SYS$SCRATCH.
Enter SHOW LOGICAL SYS$SCRATCH to see what actual directory you are using.
Many sites have SYS$SCRATCH equivalenced to SYS$LOGIN.
The \*E temporary files look like the following on VMS while \*E is running:
.ti 0.75i
ELV_1123A.1;1 ELV_1123A.2;1 SO070202.;1
Also, filtering commands (like !!dir and !}fmt) should work on VMS.
This assumes, however, that you can create temporary mailboxes and that
your mailbox quota (a sysgen parameter) is at least 256 bytes for a
single write to the mailbox.
This is the default sysgen parameter,
so there should be few people who experience filter problems.
Additionally, an attempt was made to support the standard terminals on VMS:
"vt52", "vt100", "vt200", "vt300", "vt101", "vt102".
Non-standard terminals could be supported by setting your terminal type to
and defining the logical name ELVIS_TERM.
Whatever ELVIS_TERM translates to, however, will have to be included in
Note that the upper/lowercase distinctions are significant,
and that DCL will upshift characters that are not quoted strings, so
enter DEFINE ELVIS_TERM "hp2621a".
As distributed, it would probably not be a good idea to have more than the
standard terminals in tinytcap.c (else it wouldn't be tiny, would it?).
Changes here, of course, would require a recompilation to take effect.
If you have a version of the "termcap" library and database on your system,
then you may wish to replace tinytcap with the real termcap.
.NH 2
Mike Rieser and Dale Rahn ported \*E to AmigaDOS.
The port was done using Manx Aztec C version 5.2b.
\*E uses about as much space as it can and still be small code and data.
\*E should also compile under DICE, though there may be a little trouble with
signed versus unsigned chars.
The port has been done so the same binary will run under both versions of AmigaDOS.
Under AmigaDOS 2.04, \*E supports all the documented features.
It also uses an external program ref to do tag lookup.
So, the accompanying programs: ref and ctags are recommended.
Under AmigaDOS 1.2/1.3 \*E works, buts lacks the more advanced features.
For the port to AmigaDOS 2.04, we tried to use as many Native AmigaDOS
calls as we could.
This should increase \*E's chances at being compiled with other compilers.
DICE seems to have a different default char type.
You may need to use the UCHAR() macro in tio.c.
To test it, try the :map command; if it looks right, things are cool.
For the port to AmigaDOS 1.3, we tried to make sure the program was at
least usable.
Many features are missing, most notably running commands in subshells.
Also, what we could get working, we used Aztec functions to support them,
so this part is little more compiler dependent.
Aztec is compatible with the SAS libcall #pragma.
I personally prefer using the includes that come from Commodore over the ones
supplied with Aztec, but for people with a straight Aztec installation,
I went with the default names for the Aztec pragmas.
One include you'll need is <sys/types.h>.
It's a common include when porting software just make yourself one.
It's a two line file that saves a lot of hassle especially in the \*E source.
So, make a directory where your includes are located called `sys'
and in a file below that type:
.ti +0.8i
/* sys/types.h */
.ti +0.8i
#include <exec/types.h>
When setting environment variables (either local or global) for
variables that specify a directory, make sure the variable ends in `:'
or `/'.
This saved from having to change much of the way \*E works.
The default temporary directory (if TEMP and TMP aren't specified) is "T:".
The default if HOME directory (if no HOME environment variable is set) is "S:".
To avoid conflict with other uses, \*E uses elvis.rc instead of .exrc or
where it looks for macros.
.NH 2
OS/2 2.x
\*E was ported to OS/2 by Kai Uwe Rommel.
Greg Roelofs fixed some generic bugs and added various tweaks and VIO features
not supported by OS/2's ANSI emulation.
\*E was ported using the emx port of the GNU C compiler ("emx+gcc"); other
OS/2 compilers (including the gcc/2 port) will probably not work due to
their lack of termcap support.
If you use emx 0.8f or earlier, you will need to change the -Zmtd option
to -Zmt in Makefile.mix, as noted in the comment there.
The port is derived from the MS-DOS port, so most of the MS-DOS comments should
still be valid.
In particular, the default pathnames for the temp directory and preservation
directory are the same, and wildcard.exe is used. (emx's _wildcard() function
is [optionally] used in most places, but ex.c still calls the "standard"
wildcard() function.)
Note that the executables are dynamically linked, so you'll need EMX.DLL and
EMXLIBC.DLL somewhere in your LIBPATH.
These are included with executables-only distributions and, of course, with
emx itself.
You'll also need a termcap.dat file in a location pointed at by the TERMCAP
variable; again, one is supplied.
Set the TERM variable equal to one of the listed termcap entries such as
"ansi" or "pcbios".
Finally, note that the VIO features mentioned above are not enabled by default.
Without them, \*E uses only termcap codes for screen updates and can therefore
be used remotely (e.g., in a telnet session).
If you're working at the OS/2 system console, however, the VIO features can be
enabled via a special \*E variable, "viomode" (abbreviated "vm").
Although it can be used interactively to enable most of the new features
(smooth backscrolling, cursor shape in insert mode, shorter beeps), enabling
both the auto-detection of ANSI mode (plus setting it, if necessary) and the
restoration of screen colors requires the EXINIT variable to be set.
(By the time \*E is running and the interactive command is given, it's too
late for such initializations.)
For example, add "set EXINIT=set viomode" to your config.sys file; this will
take effect at the next OS/2 reboot.
.NH 2
Other Systems
For SunOS and Solaris 1.x, use the BSD settings;
for Solaris 2.x, use the SysV settings.
Earlier versions of \*E didn't link correctly due to a quirk in Sun's
version of the "make" utility, but this version of \*E has a work-around
for that quirk so you should have no trouble at all.
For AIX, use the SysV settings in Makefile.mix, with the changes suggested
by comments there.
For other UNIXoid systems, I suggest you start with the Minix-68k settings
and then grow from that.
Minix is a nice starting point because it is a clone of Version 7 UNIX,
which was the last common ancestor of BSD UNIX and SysV UNIX.
Any operating system which claims any UNIX compatibility whatsoever
will therefore support V7/Minix code.
You may need to fiddle with #include directives or something, though.
Minix-68k is a better starting point than Minix-PC because the PC compiler
has some severe quirks.
If you're thinking of porting \*E to some non-UNIX system,
I suggest you begin by studying the "INTERNALS" section of this manual.
.NH 2
X Windows Notes
Normally, you can use the mouse to select text in an xterm window and/or
paste it as though it had been typed into that window.
Elvis changes this behavior; when elvis is running in an xterm,
any mouse click will just move the cursor.
To perform the normal xterm select & paste while elvis is running,
you must hold the <Shift> key when you make the selection or paste it.
If you resize the window, elvis will notice the change and make any
necessary changes.
(Earlier versions of elvis didn't update the value of the "window" option,
resulting in '@' signs appearing on the screen.
This has now been fixed.)
Something went wrong with that request. Please try again.