How to set the vi
or emacs
command line editing mode the Bash AND how to determine which mode is currently set?
Bash – How to set and determine the command-line editing mode of Bash
bashemacsvi
bashemacsvi
How to set the vi
or emacs
command line editing mode the Bash AND how to determine which mode is currently set?
Best Answer
Since your question is specific about bash:
To set it permanently for every new session:
or (recommended), add (or change) a line in ./inputrc:
This will set the editing mode of readline which is used by several other programs beside bash.
It is easy to unset both options:
To set one, either:
Or
The same for
emacs
. Settingvi
unsetsemacs
and viceversa.To list the state:
Or both at once:
To test if
vi
is set:Or (ksh syntax):
emacs:
Or:
or, to test that no option is set: