Scope of This Book
This book consists of 18 chapters and 4 appendixes, divided into 4 parts. , is designed to get you started using vi quickly, and to follow up with advanced skills that will let you use it effectively.
The first two chapters, , having learned some elementary editing tools.
But vi is meant to do a lot more than rudimentary word processing; the variety of commands and options enables you to shortcut a lot of editing drudgery. , concentrate on easier ways to do tasks. During your first reading, youll get at least an idea of what vi can do and what commands you might harness for your specific needs. Later, you can come back to these chapters for further study.
, provide tools that help you shift more of the editing burden to the computer. They introduce you to the ex line editor underlying vi, and they show you how to issue ex commands from within vi.
, provides an introduction to the extensions available in the four vi clones covered in this book. It centralizes in one place the descriptions of multiwindow editing, GUI interfaces, extended regular expressions, facilities that make editing easier, and several other features, providing a roadmap to what follows in the rest of this book. It also provides a pointer to source code for the original vi, which can be compiled easily on modern Unix systems (including GNU/Linux).
, describes Vim, the most popular vi clone in the early part of the 21st century.
, provides a general introduction to Vim, including where to get binary versions for popular operating systems and some of the different ways to use Vim.
, describes the major improvements in Vim over vi, such as built-in help, control over initialization, additional motion commands, and extended regular expressions.
, focuses on multiwindow editing, which is perhaps the most significant additional feature over standard vi. This chapter provides all the details on creating and using multiple windows.
, looks into the Vim command language, which lets you write scripts to customize and tailor Vim to suit your needs. Much of Vims ease of use out of the box comes from the large number of scripts that other users have already written and contributed to the Vim distribution.
, looks at Vim in modern GUI environments, such as those that are now standard on commercial Unix systems, GNU/Linux and other Unix work-alikes, and MS Windows.
, focuses on Vims use as a programmers editor, above and beyond its facilities for general text editing. Of particular value are the folding and outlining facilities, smart indenting, syntax highlighting, and edit-compile-debug cycle speedups.
, is a bit of a catch-all chapter, covering a number of interesting points that dont fit into the earlier chapters.
, describes three other popular vi clones: nvi, elvis, and vile.
, 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.
, provides useful reference material.
, 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.
, lists set
command options for vi and for all four clones.
, consolidates checklists found earlier in the book.
, 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 concepts 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 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.