Skip to Content
Learning the vi and Vim Editors, 7th Edition
book

Learning the vi and Vim Editors, 7th Edition

by Arnold Robbins, Elbert Hannah, Linda Lamb
July 2008
Beginner
492 pages
16h
English
O'Reilly Media, Inc.
Content preview from Learning the vi and Vim Editors, 7th Edition

Improvements for Editing

This section describes the features of nvi that make simple text editing easier and more powerful.

Command-Line History and Completion

nvi saves your ex command lines and makes it possible for you to edit them for resubmission.

This facility is controlled with the cedit option, whose value is a string.

When you type the first character of this string on the colon command line, nvi opens a new window on the command history that you can then edit. On any given line when you hit ENTER, nvi executes that line. ESC is a good choice for this option. (Use ^V ^[ to enter it.)

Because the ENTER key actually executes the command, be careful to use either the j or ↓ keys to move down from one line to the next.

In addition to being able to edit your command line, you can also do filename expansion. This feature is controlled with the filec option.

When you type the first character of this string on the colon command line, nvi treats the blank delimited word in front of the cursor as if it had an * appended to it and does shell-style filename expansion. ESC is also a good choice for this option. (Use ^V ^[ to enter it.) When this character is the same as for the cedit option, the command-line editing is performed only when it is entered as the first character on the colon command line.

Note

The nvi documentation indicates that TAB is another common choice for the filec option. To make this work, you must type :set filec=\TAB. In any case, in practice, using ESC for both options ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning the vi and Vim Editors, 8th Edition

Learning the vi and Vim Editors, 8th Edition

Arnold Robbins, Elbert Hannah
Vim Masterclass

Vim Masterclass

Jason Cannon
Mastering Vim

Mastering Vim

Ruslan Osipov

Publisher Resources

ISBN: 9780596529833Errata Page