Don't set emacs style keybindings for bash when in vi mode

This commit is contained in:
Nathan Broadbent
2012-03-10 16:02:12 +08:00
parent b59caec489
commit 56a5e21e4e

View File

@@ -160,8 +160,11 @@ _bind(){
if [[ "$git_keyboard_shortcuts_enabled" = "true" ]]; then if [[ "$git_keyboard_shortcuts_enabled" = "true" ]]; then
case "$TERM" in case "$TERM" in
xterm*|rxvt*) xterm*|rxvt*)
_bind "$git_commit_all_keys" "\" git_commit_all\n\"" # Uses emacs style keybindings, so vi mode is not supported for now
_bind "$git_add_and_commit_keys" "\"\e[1~ git_add_and_commit \n\"" if ! ([[ $shell == "bash" ]] && set -o | grep -q '^vi .*on$'); then
_bind "$git_commit_all_keys" "\" git_commit_all\n\""
_bind "$git_add_and_commit_keys" "\"\e[1~ git_add_and_commit \n\""
fi
# Commands are prepended with a space so that they won't be added to history. # Commands are prepended with a space so that they won't be added to history.
# Make sure this is turned on with: # Make sure this is turned on with: