Added switch for zsh / bash

This commit is contained in:
Nathan Broadbent
2012-08-12 21:16:05 +12:00
parent 55950ad896
commit 9930ba5331

View File

@@ -163,9 +163,14 @@ if [[ "$git_keyboard_shortcuts_enabled" = "true" ]]; then
case "$-" in case "$-" in
*i*) *i*)
# Uses emacs style keybindings, so vi mode is not supported for now # Uses emacs style keybindings, so vi mode is not supported for now
if ! [[ $shell == "bash" ]] || ! set -o | grep -q '^vi .*on$'; then if ! set -o | grep -q '^vi .*on$'; then
_bind "$git_commit_all_keys" "\" git_commit_all\n\"" if [[ $shell == "zsh" ]]; then
_bind "$git_add_and_commit_keys" "\"\e[1~ git_add_and_commit \n\"" _bind "$git_commit_all_keys" " git_commit_all""\n"
_bind "$git_add_and_commit_keys" " \e[1~ git_add_and_commit""\n"
else
_bind "$git_commit_all_keys" "\" git_commit_all\n\""
_bind "$git_add_and_commit_keys" "\"\e[1~ git_add_and_commit \n\""
fi
fi 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.