Linux, Unix, /etc

Danger Will Robinson! You are now entering a condescending Unix user zone!
Sponsored links (requires javascript):

More About vi

What is vi?

Vi is a text editor. More: insofar as there is any standard, vi is still the "standard" Unix text editor. The original vi was written by Bill Joy as part of BSD Unix. In time, it was ported to other Unix flavours, and by degrees took over the mantle of "standard editor" from the mighty ed. There are now versions of vi for many platforms, and it is still the one editor you are guaranteed to find on any Unix system. There is, in fact, a "family" of vi-like editors. The nearest thing to true vi today is probably nvi, maintained by Keith Bostic. This is the vi that comes with FreeBSD, but is not symlinked to /usr/bin/vi on any Linux distribution I'm aware of — for unaccountable reasons, these prefer elvis or vim. See the nvi home page for details.

Why vi?

Vi has a reputation for being cryptic, arcane and generally user-hostile. It is true that learning to use the program entails navigating a steep learning curve; once the effort of learning is over, though, vi is a fine tool for writing. I switched from emacs to vi because I found its interface the best for editing — for a touch typist, it is surely unbeatable. And then, as they say, Emacs is a nice operating system, but I prefer Unix. vi fits in with the Unix way. It is a software tool for editing files. That's what I want an editor to be. When I'm writing, I don't want to "process words" (whatever that is), I don't want tables and graphs, I don't want to run Basic programs... I could go on, but you get the idea. For more "vi advocacy", see:

Learning vi

To get you started, here is a very useful tutorial file for vi. To use it, just download, fire up vi like so:

$ vi tutor.vi

and follow the instructions in the file. For what it's worth, this how I started with vi, so it must be some use. Also, reading "An Introduction to Dislayed Editing with Vi" by Bill Joy and Mark Horton is still a good way of learning the editor.

There are also several books dealing wholly or partly with vi. I can recommend in particular the two excellent chapters in Unix Power Tools . Much of Unix Text Processing is devoted to vi, but unfortunately, it is out of print, and not likely to be reprinted. However, it is now available through O'Reilly's admirable openbooks project. O'Reilly (who else?) also have a whole book devoted to vi, now in its sixth printing— Learning the vi Editor . You can read chapter 8 of this book at O'Reilly's web site.

Walter E. Zintz's series of articles for the now-deceased UnixWorld (RIP) remain incomparable. This is an advanced tutorial: definitely not for the beginner.

My .exrc file

Vi can be heavily customised by settings in its initialisation file, called .exrc, which lives in your home directory. Here is a listing of my .exrc. Note that a lot of the stuff here has, in the best tradition of the Internet, been stolen^H^H^H^H^H^Hborrowed from others. If your web browser won't display that properly, here is a gzip'ed version for down-loading.

A Note on Pronunciation

The Jargon File , alias The New Hackers Dictionary , dictates
:vi: /V-I/, *not* /vi:/ and never /siks/ /n./
But, that gets so much else wrong... anyway, I say /vi:/.

Even More About vi

Firstly, have a look through my vi archive . This is a copy of all the vi-related files I've collected over the years. It's a bit of a jumble, but there is plenty of useful stuff in there.

Here are some other vi sites.

See also the vi FAQ, posted regularly to comp.editors.

[back to Linux, Unix, /etc]



Copyright © 1995-2007 Paul Dunne,

Sponsored links (requires javascript):