Bash vi mode configuration to default to command mode

bashvi-mode

Is it possible to configure bash vi mode so that initially it is in command mode instead on insert mode? I find that I have to press Esc far too much. It seems that there is possibility to specify this in zsh, but I have not found a way to do this in bash/readline.

Best Answer

I don't think it is possible using the standard GNU Readline Library.

However, you may be able to use xdotool for a simple hack to achieve the same effect. Appending a command to your .bashrc that simulates an Escape keypress would ensure that your term opened in command mode:

xdotool key Escape

You might want to use a slight delay, with the --delay switch, to prevent it from munging your prompt...

Note this is likely to introduce more frustration than you expect: terminals are designed to accept input; breaking that (albeit only slightly) may not prove such a good idea...

Related Question