vi Command-Line Editing

Like the vi file editor, the vi command-line editor has two modes:

  • Input mode

  • Command mode

In Input mode, every character you type is inserted into the command line. You see each character as you type it because it is echoed to the screen at the correct location in the command line. You can use the Esc key at any time while in Input mode to switch to end Input mode and change to Command mode. Each time you see the shell prompt, you are automatically put into Input mode so that you can enter UNIX commands.

If you press Esc to end Input mode, you change to Command mode. Then every letter is a command to invoke some sort of vi editing on the command line. What you type does not appear on the screen, but you will see the results ...

Get Practical UNIX 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.