Improved Editing Facilities
This section describes the features of elvis that make simple text editing easier and more powerful.
Command-Line History and Completion
Everything you type on the ex command line is saved in a buffer named
Elvis
ex
history
. This is accessible like any
other elvis buffer, but it is not
directly useful when just viewed in a window.
To access the history, you use the arrow keys to display previous commands and to edit them. Use ↑ and ↓ to page through the list, and ← and → to move around on a command line. You can insert characters by typing, and you can erase them by backspacing over them. Much as when editing in a regular vi buffer, the backspace does remove the characters, but the line is not updated as you type, so be careful!
When entering text into the Elvis ex
history
buffer (i.e., on the colon command line), the
TAB key can be used for filename
expansion. The preceding word is assumed to be a partial filename,
and elvis searches for all
matching files. If there are multiple matches, it fills in as many
characters of the name as possible, and then beeps; or, if no
additional characters are implied by the matching filenames,
elvis lists all matching names
and redisplays the command line. If there is a single match,
elvis completes the name and
appends a tab character. If there are no matches, elvis simply inserts a tab
character.
To get a real tab character, precede it with a ^V
. You can also disable filename
completion entirely by setting the Elvis ex ...
Get Learning the vi and Vim Editors, 7th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.