I just discovered the wonders of set -o vi, and am curious if it is possible to customize this vi shell mode in some of the same ways you can customized vi or vim?For example, create a custom key binding to map a more convenient key or key combo to esc?If it's not currently supported, how difficult would it be to alter the source code of the program and hardcode in some customizations, or would that be a bad idea?
Custom key bindings for vi shell mode, ie, set -o vi?
bash;vi
Yes, you can change key mappings (for either vi- or emacs-like mode) with the bind builtin. This is actually a readline feature (so you can have vi-like bindings in all readline programs, not just bash).The key you're looking for is called vi-movement-mode, and defaults to \e (escape). You could additionally bind it to (and this is rather silly) equals like this. The second line gets rid of the binding to escape:$ bind =:vi-movement-mode $ bind -r \eRunning bind -p will show you all the keys you can bind, and their current bindings (if any).You can put bind commands in your .bashrc, or you can edit ~/.inputrc to make it apply to all readline programs you run. The readline docs contain full details.