There are a number of freely available "clones" of the
editor. Appendix E, vi and the Internet
provides a pointer to a web site that lists all known
clones. We have chosen to cover
four of the most popular ones. They are:
Version 1.79 of Keith Bostic's nvi
Version 2.0 of Steve Kirkendall's elvis
Version 5.0 of Bram Moolenaar's vim
Version 7.4 of vile
Kevin Buettner, Tom Dickey, and Paul Fox
The clones were written
because the source code for vi
is not freely available,
making it impossible to either port vi
to a non-UNIX
environment or to study the code,
and/or because UNIX vi
(or another clone!)
did not provide desired functionality.
For example, UNIX vi
often has limits on the maximum
length of a line, and it cannot edit binary files.
(The chapters on the various programs present more information about each
Each program provides a large number of extensions to UNIX
; often, several of the clones provide the same
extensions, although usually not in an identical way.
Instead of repeating the treatment of each common feature in each
program's chapter, we have centralized the discussion here.
You can think of this chapter as presenting "what the
with each clone's chapter presenting "how the clone
This chapter covers the following topics:
- Multiwindow editing
This is the ability to split the screen
into multiple "windows."[
You can edit a different file in each window, or have several views into
the same file.
This is perhaps the single most important extension over regular
- GUI interfaces
All of the clones except nvi
can be compiled to support
an X Window interface. If you have a system running X, use of the GUI
version may be preferable to splitting the screen
of an xterm
(or other terminal emulator);
the GUI versions generally provide such nice features as scrollbars
and multiple fonts. The native GUIs of other operating systems may
also be supported.
- Extended regular expressions
All of the clones make it possible to match text using regular
expressions that are similar or identical to those provided by
the UNIX egrep
- Enhanced tags
As described in Section 7.5.3, "Using Tags"
in Chapter 7
Chapter 7, Advanced Editing
, you can use the ctags
program to build up a
searchable database of your files. The clones make it possible
to "stack" tags, by saving your current location when
you do a tag search. You can then return to that location.
Multiple locations can be saved in a Last In First Out (LIFO) order,
producing a stack of locations.
Several of the vi
clone authors and the author of
at least one ctags
clone have gotten together
to define a standard form for an enhanced version of the
format. In particular, it is now easier to
use the tags functionality with programs written in
C++, which allows overloaded function names.
- Improved editing facilities
All of the clones provide
the ability to edit the ex
"infinite undo" capability,
arbitrary length lines and eight-bit data,
(at least an option) to scroll the screen
left to right for long lines instead of wrapping long lines,
as well as other features.
- Programming assistance
Several of the editors provide features that allow you to stay
within the editor during the typical
cycle of software development.
- Syntax highlighting
, you can arrange to display different
parts of a file in
different colors and/or fonts.
This is particularly useful for editing program source code.
There is one additional feature in the clones that we have chosen
to cover: extension languages.
As of May 1998,
has preliminary support for Perl and Tcl integration,
has its own C-like expression evaluator,[
a C-like expression evaluator, plus
support for Perl, Python, and Tcl integration,
, which has always had its own built-in
has preliminary support for Perl integration.
The extension language integration and support are very recent for
all of the programs and will undoubtedly change significantly.
For this reason, any discussion of the extension language facilities
would be obsolete almost as soon as this book goes to press.
We recommend that you check the online documentation for your
clone if you're interested in programming your editor with
an extension language.[
Extension languages are a feature worth watching; they promise to
bring a new dimension of power to vi
The use of well-known programming languages, such as Perl, Python,
and Tcl, is an additional advantage, since it is likely that
users will already know one or more of them.