O'Reilly logo

Learning the vi Editor, Sixth Edition by Linda Lamb, Arnold Robbins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

9.8. Improvements for Editing

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

9.8.1. Command-Line History and Completion

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

This facility is controlled with the cedit option.

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. When you hit RETURN on any given line, nvi executes that line. ESC is a good choice for this option. (Use ^V ^[ to enter it.)

Because the RETURN 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.[4] (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.

[4] Although the nvi documentation indicates that TAB is another common choice, we could ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required