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

11.8. Improved Editing Facilities

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

11.8.1. Command-Line History and Completion

vim keeps a history of your ex commands, search strings, and expressions in its extended command language. These are three separate histories. The size of each is controlled by the history option; the default is 20. You may wish to increase it in your .vimrc file, although vim does take steps to maintain only unique commands.

To access the history, use the cursor key on the colon command line. This will move backwards through the saved commands (most recent first). The key will move forwards. You can move around on the command line using the and keys. By default, text that you type is inserted into the command line. You can use the INS (Insert) key on your keyboard to toggle this mode, in which case what you type will replace what's on the command line. The BACKSPACE key will erase characters.

You can use the SHIFT or CTRL key in combination with the and keys to move the cursor left or right ...

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