The in-line edit mode enables you to
edit a previous command on the current command line. Use vi
commands to move and edit the previous command line.
| Command Format: |
| set
[-+]o vi |
Using set -o vi turns
command-line
editing on, while set +o vi turns
it off. Once the editing has been turned on, pressing the Esc
key activates the in-line editor. You then have access to vi commands.
In Figure ,
the use of the more
command generates an error since there was a misspelling of
"words". Next, the set
-o vi command is used to turn
vi editing on, and the k
key is then used to repeat
the previous command so it can be corrected. In this example, the user
edited the command to change
worfs to words.
The k key will move up through the command list and the j key
will move down. A way to remember these is k is for kick up and
j is for jump down.
The vi
commands shown in Figure
can be used to edit a command line. The Return key is pressed after
all changes are made.
Note - The arrow keys cannot
be used to reposition the cursor during in-line editing.
|