Like emacs-mode, vi-mode essentially creates a one-line editing window into the history file. vi-mode is popular because vi is the most standard UNIX editor. But the function for which vi was designed, writing C programs, has different editing requirements from those of command interpreters. As a result, although it is possible to do complex things in vi with relatively few keystrokes, the relatively simple things you need to do in bash sometimes take too many keystrokes.
Like vi, vi-mode has two modes of its own: input and control mode. The former is for typing commands (as in normal bash use); the latter is for moving around the command line and the history file. When you are in input mode, you can type commands in and hit RETURN to run them. In addition, you have minimal editing capabilities via control characters, which are summarized in Table 2.7.
Table 2-7. Editing Commands in vi Input Mode
|DEL||Delete previous character|
|CTRL-W||Erase previous word (i.e., erase until a blank)|
|CTRL-V||Quote the next character|
|ESC||Enter control mode (see below)|
Note that at least some of these—depending on which version of UNIX you have—are the same as the editing commands provided by UNIX through its terminal interface.  vi-mode will use your “erase” character as the “delete previous character” key; usually it is set to DEL or CTRL-H (BACKSPACE). CTRL-V works the same way as in emacs-mode; it causes the next character to appear in the command line as is and ...