compile-debug cycle speedups.
Chapter 15, Other Cool Stuff in Vim , is a bit of a catch-all chapter, covering a number
of
interesting points that dont fit into the earlier chapters.
Part III, Other vi Clones , describes three other popular vi clones: nvi, elvis, and vile.
Chapter 16, nvi: New vi , Chapter 17, Elvis , and Chapter 18, vile: vi Like Emacs , cover
the various vi clonesnvi, elvis, and vileshowing you how to use their extensions
to vi and discussing the features that are specific to each one.
Part IV, Appendixes , provides useful reference material.
xiv | Preface
Appendix A, The vi, ex, and Vim Editors , lists all vi and ex commands, sorted by function. It also provides an alphabetical list of ex commands. Selected vi and ex commands
from Vim are also included.
Appendix B, Setting Options , lists set command options for vi and for all four clones.
Appendix C, Problem Checklists , consolidates checklists found earlier in the book.
Appendix D, vi and the Internet , describes vis place in the larger Unix and Internet culture.
How the Material Is Presented
Our philosophy is to give you a good overview of what we feel are vi survival materials
for the new user. Learning a new editor, especially an editor with all the options of
vi, can seem like an overwhelming task. We have made an effort to present basic con-
cepts and commands in an easy-to-read and logical manner.
After providing the basics for vi, which are usable everywhere, we move on to cover
Vim in depth. We then round out our coverage of the vi landscape by looking at nvi,
elvis, and vile. The following sections describe the conventions used in this book.
Discussion of vi Commands
A picture of a keyboard button, like the one on the left, marks the main discussion
i
of that particular keyboard command or of related commands. You will find a
brief introduction to the main concept before it is broken down into task-oriented
sections. We then present the appropriate command to use in each case, along with a
description of the command and the proper syntax for using it.
Conventions
In syntax descriptions and examples, what you would actually type is shown in the
Courier font, as are all command names. Filenames are also shown in Courier, as are
program options. Variables (which you would not type literally, but would replace with
an actual value when you type the command) are shown in Courier italic . Brackets
indicate that a variable is optional. For example, in the syntax line:
vi [ filename ]
filename would be replaced by an actual filename. The brackets indicate that the vi
command can be invoked without specifying a filename at all. The brackets themselves
are not typed.
Preface | xv
Certain examples show the effect of commands typed at the Unix shell prompt. In such
examples, what you actually type is shown in Courier Bold, to distinguish it from the
system response. For example:
$ ls
ch01.xml ch02.xml ch03.xml ch04.xml
In code examples, italic indicates a comment that is not to be typed. Otherwise, italic
introduces special terms and emphasizes anything that needs emphasis.
Following traditional Unix documentation convention, references of the form
printf (3) refer to the online manual (accessed via the man command). This example refers
to the entry for the printf( ) function in section 3 of the manual (you would type man
3 printf on most systems to see it).
Keystrokes
Special keystrokes are shown in a box. For example:
iWith a ESC
Throughout the book, you will also find columns of vi commands and their results:
Keystrokes
Results
ZZ
"practice" [New file] 6 lines, 320 characters
Give the write and save command, ZZ. Your file is saved as a regular Unix file.
In the preceding example, the command ZZ is shown in the left column. In the window
to the right is a line (or several lines) of the screen that show the result of the
command.
Cursor position is shown in reverse video. In this instance, since ZZ saves and writes
the file, you see the status line shown when a file is written; the cursor position is not
shown. Below the window is an explanation of the command and its result.
Sometimes vi commands are issued by pressing the CTRL key and another key si-
multaneously. In the text, this combination keystroke is usually written within a box
(for example, CTRL-G ). In code examples, it is written by preceding the name of the
key with a caret (^). For example, ^G means to hold down CTRL while pressing the
G key.
Problem Checklist
A problem checklist is included in those sections where you may run into some trouble.
You can skim these checklists and go back to them when you actually encounter a
problem. All of the problem checklists are also collected in Appendix C, for ease of
reference.
xvi | Preface
What You Need to Know Before Starting
This book assumes you have already read Learning the Unix Operating System
(OReilly), or some other introduction to Unix. You should already know how to:
Log in and log out