The downside is that while vim mode works nicely on bash, other commands like gdb etc that also use read line aren’t as easy to get into vim mode, if they support it at all…
The downside is that while vim mode works nicely on bash, other commands like gdb etc that also use read line aren’t as easy to get into vim mode, if they support it at all…
set editing-mode vi
set keymap vi-command
That does the trick for me in python shell, psql, etc.First thing I do on any fresh unix box is setting above, and echo "set -o vi" >> ~/.bash_profile.
bind -vHere is my config from a happy gdb vim mode user :
set editing-mode vi
# If set to ‘on’, Readline performs filename matching and completion in a case-insensitive fashion. The default value is ‘off’.
set completion-ignore-case on
# If set to ‘on’, Readline displays possible completions using different colors to indicate their file type. The color definitions are taken from the
set colored-stats on
# Perform partial (common) completion on the first Tab press, only start # cycling full results on the second Tab press (from bash version 5)
set menu-complete-display-prefix on
### MAPPINGS ###
# Allow to refresh the screen
"\C-l":clear-screen
# If there are multiple matches for completion, Tab should cycle through them
TAB:menu-complete