Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

A new clone of vi is coming soon: ELVIS

51 views
Skip to first unread message

Steve Kirkendall

unread,
Apr 20, 1990, 4:37:32 PM4/20/90
to
I've been working on a new clone of vi. Somebody suggested that the folks on
this newsgroup might be interested, so...

The clone is called "elvis", some of its major features are:

* The text is stored in a temporary file, just like the real vi,
and UNLIKE stevie. Because of this, you can edit files that are
larger than a single process' data space. Also, you can recover
your file after a crash or power failure.

* A fairly complete "ex" mode is supported. Elvis can execute most
ex scripts. The :@, :abbr, and :preserve commands are missing,
and :recover has been replaced by a separate program. Every other
command is present, though, including :map and :change.

* All visual-mode commands work, except @ and *appending* to named
buffers. List support is missing. There are a few extensions:
shift-K looks up the word that the cursor is on & displays some
information about it (currently it tries to find a function header,
given the function name) and ## increments a number.

* Arrow keys work in input mode. In fact, if you invoke the editor
via the name "input", then it will start editing in input mode.
You can make your changes, and then exit by hitting control-Z twice,
and NEVER go into visual command mode. In other words, elvis can
act pretty much like a NORMAL editor -- something that the real vi
certainly can't do.

* Long lines are displayed differently. Where vi and stevie wrap the
line onto several rows of the screen, elvis displays it on one row
and allows you to scroll sideways.

* In input mode, you can backspace past the beginning of a line.

* Elvis can (optionally) interpret the \fB, \fI, and \fU sequences
to display bold/italic/underlined characters on the screen.

* Elvis refreshes the screen very quickly.

* Elvis allows wildcards in filenames. For example, you can say
":n *.c" to edit all of the C source files in the directory.
The real vi does this, too, but stevie doesn't.

* For regular expressions, elvis uses a syntax that is very similar to
the real vi's. It is more compatible than stevie.

* It has a 40-page manual.

The first version of elvis was posted to comp.os.minix in late January.
A set of patches/extensions were posted there about three weeks later,
in mid-February. Since then, elvis has been improved/debugged. More
importantly, it has been ported to MS-DOS. When it works under Atari TOS,
I will post it to comp.sources.SOMETHING. Hopefully, this will be in a
week or so.

My motivations for writing elvis were:
1) I wanted a clone of vi that would run under Minix.
2) I wanted the source to a version of vi, so that I could change
a few things.
3) I wanted an editor that didn't store the edited file in *volatile*
memory.
-------------------------------------------------------------------------------
Steve Kirkendall, kirk...@cs.pdx.edu, uunet!tektronix!psueea!eecs!kirkenda
My favorite word is "flabbergast"

Bernie Cosell

unread,
Apr 23, 1990, 8:09:32 AM4/23/90
to
kirk...@eecs.cs.pdx.edu (Steve Kirkendall) writes:

}I've been working on a new clone of vi. Somebody suggested that the folks on
}this newsgroup might be interested, so...

}The clone is called "elvis", some of its major features are:

} * Arrow keys work in input mode. In fact, if you invoke the editor


} via the name "input", then it will start editing in input mode.
} You can make your changes, and then exit by hitting control-Z twice,
} and NEVER go into visual command mode. In other words, elvis can
} act pretty much like a NORMAL editor -- something that the real vi
} certainly can't do.

Untrue. A simple "map! ^V^[[A ^V^[ka
map! ^V^[[B ^V^[ja
...
All do just fine at having the arrows work in input mode. Although I don't
have such a binidng, I'd be surprised if: map! ^Z^Z ^V^[ZZ
or something like it didn't work. Many of us have a LOT of neat input mode
commands, and it is one of vi's real strengths.

} * In input mode, you can backspace past the beginning of a line.

Ugh. Since I now occasionally use a vi-clone which has this
(mis)feature, for me, at least, I can state unequivocally that the way
'real vi' handles ends of lines is MUCH nicer than treating 'newline'
as "just another character in the file".

/Bernie\

Thom Gillespie

unread,
Apr 23, 1990, 3:48:09 PM4/23/90
to
I've been reading the Elvis postings and would like to read the vi source code.
Is there an easy place to reach to look at it. I've tried a few machines at
Berkeley but no luck. Thanks.

--Thom Gillespie

Peter da Silva

unread,
Apr 24, 1990, 9:25:54 AM4/24/90
to
In article <55...@bbn.COM> cos...@bbn.com (Bernie Cosell) writes:
> A simple "map! ^V^[[A ^V^[ka
> map! ^V^[[B ^V^[ja

> All do just fine at having the arrows work in input mode.

Only if you don't care that this breaks "undo".
--
_--_|\ `-_-' Peter da Silva. +1 713 274 5180. <pe...@ficc.uu.net>
/ \ 'U` Have you hugged your wolf today? <pe...@sugar.hackercorp.com>
\_.--._/
v Disclaimer: People have opinions, organisations have policy.

Leslie Mikesell

unread,
Apr 26, 1990, 3:01:20 PM4/26/90
to
In article <5O=2YPC...@ficc.uu.net> pe...@ficc.uu.net (Peter da Silva) writes:
>> A simple "map! ^V^[[A ^V^[ka
>> map! ^V^[[B ^V^[ja
>> All do just fine at having the arrows work in input mode.

>Only if you don't care that this breaks "undo".

The vi that comes with SysVr3.2 seems to have this built-in, so the
arrows do work in input mode, except that if the cursor hits the
end of any line and you started input mode with "i", you are no longer
in insert mode. The MKS vi for DOS uses arrows also, but will stay
in insert mode in that circumstance. In both versions 'u' only undoes
the text insertion after the last motion.

Les Mikesell
l...@chinet.chi.il.us

Peter da Silva

unread,
Apr 27, 1990, 9:52:05 AM4/27/90
to
> >> A simple "map! ^V^[[A ^V^[ka
> >> map! ^V^[[B ^V^[ja
> >> All do just fine at having the arrows work in input mode.

> >Only if you don't care that this breaks "undo".

> The vi that comes with SysVr3.2 seems to have this built-in, so the

> arrows do work in input mode, ...

Well, it does this by automatically setting up the macros based on the
"kn" fields in termcap (or, more likely, the "key_" fields in terminfo).
Which still leaves you with the problem that this kills your undo/redo
stuff. Also, thank you for noting that if you do this when the cursor is
at the...

> end of any line and you started input mode with "i", you are no longer
> in insert mode.

Basically, if a command in a macro fails the rest of the macro is aborted.
And this includes the "return to insert mode" in this case.

> The MKS vi for DOS uses arrows also, but will stay
> in insert mode in that circumstance. In both versions 'u' only undoes
> the text insertion after the last motion.

Oh yeh, on televideo terminals the standard "kd" is "^V", which is even
more of a problem.

Steve Kirkendall

unread,
Apr 27, 1990, 1:23:15 PM4/27/90
to
In article <1990Apr26....@chinet.chi.il.us> l...@chinet.chi.il.us (Leslie Mikesell) writes:
>In article <5O=2YPC...@ficc.uu.net> pe...@ficc.uu.net (Peter da Silva) writes:
>>> A simple "map! ^V^[[A ^V^[ka
>>> map! ^V^[[B ^V^[ja
>>> All do just fine at having the arrows work in input mode.
>
>>Only if you don't care that this breaks "undo".

There are also a few other problems: vertical movements in column 1 don't work
right, and it doesn't get the key definitions from termcap, and doesn't work
quite right in replace mode.

>The vi that comes with SysVr3.2 seems to have this built-in, so the
>arrows do work in input mode, except that if the cursor hits the
>end of any line and you started input mode with "i", you are no longer
>in insert mode. The MKS vi for DOS uses arrows also, but will stay
>in insert mode in that circumstance. In both versions 'u' only undoes
>the text insertion after the last motion.

In elvis, it works like this:

- During startup, the arrow keys are mapped appropriately, from the termcap
entry. The <PgUp>, <PgDn>, <Home>, and <End> keys are also mapped from
termcap; their capability strings are named PU, PD, HM, and EN, respectively.
These names were borrowed from SCO Xenix.

- When you go into input mode, all of those keys do what you would expect.
The <Up> and <Down> arrow keys try to keep the cursor in the same column,
but if you move onto a shorter line and the cursor would be past the end
of the line, then the cursor will sit on the last character of that line.
The <End> key moves the cursor past the last character in the current line,
so that you can append. The <Right> arrow key can move past the last
character, too. Also, the <Del> key performs a visual "x" command.
There is still no way to delete lines while in input mode, though.

- The arrow keys also work in replace mode (shift-R). Elvis remembers the
distinction between input mode and replace mode after you use the cursor
keys.

- When you exit from input mode, a "u" command will undo *ALL* of your changes
no matter how scattered they were. I wish it didn't act this way, but it
does. I wish it acted like MKS vi.

- If you give the "." command, then elvis will insert a copy of the text that
was inserted after the last motion. It does *NOT* attempt to repeat a whole
set of scattered changes. The asymetry of the "." and "u" really bugs me.

- You can make elvis *START UP* in input mode in any of three ways:
1) your ".exrc" file can do a "set inputmode" command.
2) you can start elvis with the "-i" flag: "elvis -i myfile"
3) you can link "elvis" to "input", and invoke the editor by that name:
"input myfile"

Kevin Routh x622

unread,
Apr 27, 1990, 2:56:18 PM4/27/90
to
I too have been reading the ELVIS postings and am intrigued with the idea of
viewing the Berkeley Vi source code. Is this really available and if so, where
is it? I have done some work on the STEVIE editor and would like to add a
few of the functions which it lacks with respect to the Unix Vi. If anyone
can help me find this code, I'd really appreciate it! Thanks in advance.

Kevin

--
Kevin Routh (ro...@eltanin.rtp.semi.harris.com)
Harris Smart Power Products
Durham, NC
(919) 361-1600

0 new messages