Enter Unix commands
Change directories
List files in a directory
Create, copy, and remove files
Familiarity with grep (a global search program) and wildcard characters is also helpful.
Comments and Questions
Please address comments and questions concerning this book to the publisher:
OReilly Media, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
800-998-9938 (in the United States or Canada)
707-829-0515 (international or local)
707-829-0104 (fax)
To ask technical questions or comment on the book, send email to:
bookquestions@oreilly.com
The web site for this book lists examples, errata, and plans for future editions. You can
access this page at:
http://www.oreilly.com/catalog/9780596529833
For more information about our books, conferences, software, resource centers, and
the OReilly Network, see our web site:
http://www.oreilly.com
Safari® Books Online
When you see a Safari® Books Online icon on the cover of your favorite
technology book, that means the book is available online through the
OReilly Network Safari Bookshelf.
Safari offers a solution thats better than e-books. Its a virtual library that lets you easily
search thousands of top tech books, cut and paste code samples, download chapters,
Preface | xvii
and find quick answers when you need the most accurate, current information. Try it
for free at http://safari.oreilly.com .
About the Previous Editions
In the fifth edition of this book (then called Learning the vi Editor ), the ex editor com-
mands were first discussed more fully. In Chapters 5, 6, and 7, the complex features of ex and vi were clarified by adding more examples, in topics such as regular expression
syntax, global replacement, .exrc files, word abbreviations, keyboard maps, and edit-
ing scripts. A few of the examples were drawn from articles in Unix World magazine.
Walter Zintz wrote a two-part tutorial* on vi that taught us a few things we didnt
know, and that also had a lot of clever examples illustrating features we did already
cover in the book. Ray Swartz also had a helpful tip in one of his columns. We are
grateful for the ideas in these articles.
The sixth edition of Learning the vi Editor introduced coverage of four freely available
clones, or work-alike editors. Many of them have improvements over the original
vi. One could thus say that there is a family of vi editors, and the books goal was
to teach you what you need to know to use them. That edition treated nvi, Vim,
elvis, and vile equally.
The sixth edition also added the following features:
Many minor corrections and additions were made to the basic text.
For each chapter where appropriate, a command summary was added at the
end.
New chapters covered each vi clone, the features and/or extensions common to
two or more of the clones, and multiwindow editing.
The chapters for each vi clone described a bit of that programs history and goals,
its unique features, and where to get it.
A new appendix described vis place in the larger Unix and Internet culture.
Preface to the Seventh Edition
This seventh edition of Learning the vi and Vim Editors retains all the good features of
the sixth edition. Time has proven Vim to be the most popular vi clone, so this edition
adds considerably expanded coverage of that editor (and gives it a place in the title).
However, to be relevant for as many users as possible, we have retained and updated
the material on nvi, elvis, and vile.
* vi Tips for Power Users, Unix World , April 1990; and Using vi to Automate Complex Edits, Unix
World , May 1990. Both articles by Walter Zintz. (See Appendix D for the web location of these articles.)
Answers to Unix, Unix World , August 1990.
xviii | Preface
Whats New
The following features are new for this edition:
Once again, we have corrected errors in the basic text.
Seven new chapters provide exhaustive coverage of Vim.
The material on nvi, elvis, and vile has been brought up-to-date.
The previous editions two reference appendixes on ex and vi have been condensed
into one and now contain selected additional material on Vim.
The other appendixes have been updated as well.
Versions
The following programs were used for testing out various vi features:
The Solaris version of vi for a reference version of Unix vi
Version 1.79 of Keith Bostics nvi
Version 2.2 of Steve Kirkendalls elvis
Version 7.1 of Bram Moolenaars Vim
Version 9.6 of vile, by Kevin Buettner, Tom Dickey, and Paul Fox
Acknowledgments from the Sixth Edition
First and foremost, thanks to my wife, Miriam, for taking care of the kids while I was
working on this book, particularly during the witching hours right before meal times.
I owe her large amounts of quiet time and ice cream.
Paul Manno, of the Georgia Tech College of Computing, provided invaluable help in
pacifying my printing software. Len Muellner and Erik Ray of OReilly & Associates
helped with the SGML software. Jerry Peeks vi macros for SGML were invaluable.
Although all of the programs were used during the preparation of the new and revised