disable keyboard shortcuts by default

This commit is contained in:
Nathan Broadbent
2011-10-20 08:32:50 +08:00
parent a66a6d4d3f
commit d04e2b464e
2 changed files with 15 additions and 10 deletions

View File

@@ -65,6 +65,8 @@ git_show_alias="gsh"
# Git Keyboard Shortcuts # Git Keyboard Shortcuts
# --------------------------------------------- # ---------------------------------------------
# Keyboard shortcuts are off by default. Set this to 'true' to enable them.
git_keyboard_shortcuts_enabled="false"
git_status_shortcuts_keys="\C- " # CTRL+SPACE git_status_shortcuts_keys="\C- " # CTRL+SPACE
git_commit_all_keys="\C-x " # CTRL+x, SPACE git_commit_all_keys="\C-x " # CTRL+x, SPACE
git_add_and_commit_keys="\C-xc" # CTRL+x, c git_add_and_commit_keys="\C-xc" # CTRL+x, c

View File

@@ -110,15 +110,18 @@ _bind(){
fi fi
} }
case "$TERM" in # If keyboard shortcuts are enabled
xterm*|rxvt*) if [[ "$git_keyboard_shortcuts_enabled" = "true" ]]; then
_bind "$git_status_shortcuts_keys" " git_status_shortcuts\n" case "$TERM" in
_bind "$git_commit_all_keys" " git_commit_all\n" xterm*|rxvt*)
_bind "$git_add_and_commit_keys" "\e[1~ git_add_and_commit \n" _bind "$git_status_shortcuts_keys" " git_status_shortcuts\n"
_bind "$git_commit_all_keys" " git_commit_all\n"
_bind "$git_add_and_commit_keys" "\e[1~ git_add_and_commit \n"
# 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:
# zsh: setopt histignorespace histignoredups # zsh: setopt histignorespace histignoredups
# bash: HISTCONTROL=ignorespace:ignoredups # bash: HISTCONTROL=ignorespace:ignoredups
esac esac
fi