Linux, Unix, /etc

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

Review of Learning the vi Editor

Title: Learning the vi Editor (6th ed.)
Author: Linda Lamb & Arnold Robbins
Publisher: O'Reilly
ISBN: 1565924266
Price: $24.95
Pages: 327
Date: February 1986 (1st ed.); November 1998 (6th ed.)

Introduction

The most notable feature of this, the sixth edition of one of the oldest O'Reilly books, is that a good half of the text is devoted to the "new" vi clones that are now very common. Indeed, if you're running Linux, what you call "vi" is really a clone — the original vi was never ported to Linux, nor is it ever likely to be now: the BSD vi, nvi, is the closest you're likely to get.

Before we take a look at the book, though, it's worth saying a bit about why we should care about vi at all. I mean, isn't it completely out of date? Well, no. Vi is old, as computer programs go. However, it is still a very capable text editor; it is still ubiquitous on Unix and Unix-like systems; and it remains for many people the editor of choice. After all, if something works for you, why reinvent the wheel?

The Book in Outline

The book falls into three sections: Basic and Advanced vi, Extensions and Clones, and the Appendices.

Basic and Advanced Vi

The seven chapters in this first section form the core of the original book. Actually, this stuff has its origins in Unix Text Processing. Here is an complete course in vi that takes the reader from absolute beginner to advanced levels of vi wizardry.

Extensions and Clones

This is new to the 6th edition, and forms almost half of the new book. There is, in fact, a "family" of vi-like editors. Four of the most popular clones are covered here: The nearest thing to true vi today is probably nvi, maintained by Keith Bostic. This is the vi that comes with FreeBSD, and so comes closest to being the "one true vi", indirectly descended from the Bill Joy's program written at Berkeley. nvi is not symlinked to /usr/bin/vi on any Linux distribution I'm aware of — for unaccountable reasons, these prefer elvis or vim.

vim is impressive as an editor which has taken the "vi idea" and extended it in all directions. Indeed, it seems that an "emacsulation" of vim is in progress, with a built-in mail client available as an optional extra.

Appendices

Quick Reference
This appendix is useful but incomplete. For instance,

w,W,b,B		forward, backward by word 

is insufficient. What's important here is that the pairs w and W, and b and B, use different definitions of a "word". The capital letters include punctuation characters in their definition, the lowercase ones don't. So, "this_simple_example" is one word to W and B, three to w and b. This distinction is made earlier in the book, but the difference should have been made clear in the command summary as well.
ex Commands
The alphabetical list of ex commands is very handy. People often forget that vi was originally simply the "friendly" full-screen interface to ex.
Setting Options
The most important options for Solaris 2.6 vi, nvi 1.79, vim 5.1 and vile 8.0.
Problem Checking
I found this inconsequential. If you've read through the book, nothing here describes a "problem" apart from problems with termcap/terminfo entries, surely a rare occurrence in this day and age.
vi and the Internet
I really liked this. It is accurate and up to date.

In Summary

The style is anondyne. This makes it rather difficult to read, for me at any rate.

Then, I must say that the book is hardly essential reading. If you already have Unix Power Tools you can get by with the two excellent vi chapters in that book, though an absolute novice may find it hard going without recourse to a gentler introdction. This the first few chapters of Learning the vi Editor certainly provide. So, this is a grand little book for anyone who wants to learn vi from scratch.

However, while fine for the beginner, this book provides the already competent user with little. The chapter "Advanced Editing" is somewhat misnamed. It certainly covers more advanced topics than the previous chapters, but the material is actually still rather basic, and mostly stuff that every vi user needs to know. It is a shame that more of the sort of material provided by Walter E. Zintz in his incomparable series of articles for Unixworld was not provided.

Paul Dunne 2001


[back to Linux, Unix, /etc]



Copyright © 1995-2007 Paul Dunne,

Sponsored links (requires javascript):