Created
July 21, 2016 16:49
-
-
Save dennisfaust/9404dd81bb533472a8bbd1b06e12027a to your computer and use it in GitHub Desktop.
Set VI Mode in Readline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tl;dr: | |
$ set -o vi | |
$ bind '"\ee": emacs-editing-mode' | |
Then hit Esc-e | |
$ bind -P| grep edit | |
edit-and-execute-command can be found on "\C-x\C-e". | |
emacs-editing-mode is not bound to any keys | |
vi-editing-mode is not bound to any keys | |
You can do the following so that when you type Esc+e it will toggle between the 2 modes. | |
$ set -o emacs | |
$ bind '"\ee": vi-editing-mode' | |
$ set -o vi | |
$ bind '"\ee": emacs-editing-mode' | |
The bind command now shows this: | |
in vi mode | |
$ bind -P |grep edit | |
edit-and-execute-command is not bound to any keys | |
emacs-editing-mode can be found on "\ee". | |
vi-editing-mode is not bound to any keys in emacs mode | |
$ bind -P |grep edit | |
edit-and-execute-command can be found on "\C-x\C-e". | |
emacs-editing-mode is not bound to any keys | |
vi-editing-mode can be found on "\ee". | |
Now you can use Esc+e to toggle between the 2 different modes. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment