Chapter 5. Introducing the ex Editor
If this is a book on
vi and Vim, why would we include a chapter on another
ex is not really another editor.
vi is the visual
mode of the more general, underlying line editor, which is
ex commands can be useful to you while you are working in
since they can save you a lot of editing time. Most of these commands can
be used without ever leaving
You can think of the
ex command line as a third mode, alongside
the regular command and insert modes.
vi motion and text-modification commands we’ve seen
in the previous chapters are nice, but if that’s all you’ve got,
you may as well use Notepad or something similar. The reason
vi lovers love
vi is because of
ex is where
the power is!
Vim provides the underlying
ex editor, with many enhancements over
the original one. On systems where
vi is Vim,
ex usually also
invokes Vim in
In this and the following chapters in Part I, we don’t distinguish
vi and Vim, since everything in these chapters applies
to both. While reading, feel free to think of “
vi” as standing for
vi and Vim.”
You already know how to think of files as a sequence of numbered
ex gives you editing commands with greater mobility and
ex, you can move easily between files and transfer text from one file to another in a variety of ways. You can quickly edit blocks of text larger than a single screen. And with global replacement you can make substitutions ...