The Korn shell has an additional feature which allows you to edit the
current or past commands using vi-like or Emacs-like
commands. You choose the editor by setting the environmental
variable VISUAL to the editor you want. In vi mode, hit [escape] then use the vi movement keys (h,j,k,l) (but
not the arrow keys) and vi commands to edit the Unix command.
Entering [return] submits the edited command to the shell.
In Emacs mode, hit [escape], then use the Emacs movement keys (^p,^n) (but not the arrow keys) and Emacs commands to edit the Unix command. Entering [return] submits the edited command to the shell.