I want to switch to vi editing mode in a readline environment. But I don't want to use 'set -o vi'. I want to temporarily switch using a keyboard shortcut. The man page says I can do this with M-C-j. But that doesn't work for me.
I'm using Ubuntu and an xterm. Doesn't work under gnome-terminal either.
Best Answer
I'd confirm that the keyboard mapping Meta+Control+j is in fact correct on your system. You can use this command to list all the keybinds for the various modes of Bash. On my system there wasn't a keybinding either.
You can do the following so that when you type Esc+e it will toggle between the 2 modes.
The
bind
command now shows this:in vi mode
in emacs mode
Now you can use Esc+e to toggle between the 2 different modes.