diff --git a/git.scmbrc.example b/git.scmbrc.example index 3044db6..8e37c17 100644 --- a/git.scmbrc.example +++ b/git.scmbrc.example @@ -65,6 +65,8 @@ git_show_alias="gsh" # 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_commit_all_keys="\C-x " # CTRL+x, SPACE git_add_and_commit_keys="\C-xc" # CTRL+x, c diff --git a/lib/git/aliases_and_bindings.sh b/lib/git/aliases_and_bindings.sh index 615fa0e..eab48df 100644 --- a/lib/git/aliases_and_bindings.sh +++ b/lib/git/aliases_and_bindings.sh @@ -110,15 +110,18 @@ _bind(){ fi } -case "$TERM" in -xterm*|rxvt*) - _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" +# If keyboard shortcuts are enabled +if [[ "$git_keyboard_shortcuts_enabled" = "true" ]]; then + case "$TERM" in + xterm*|rxvt*) + _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. - # Make sure this is turned on with: - # zsh: setopt histignorespace histignoredups - # bash: HISTCONTROL=ignorespace:ignoredups -esac + # Commands are prepended with a space so that they won't be added to history. + # Make sure this is turned on with: + # zsh: setopt histignorespace histignoredups + # bash: HISTCONTROL=ignorespace:ignoredups + esac +fi