Ignore bindings if not defined

This commit is contained in:
Nathan Broadbent
2011-10-19 21:24:21 +08:00
parent a6bc784cc5
commit 11d453d8fb

View File

@@ -101,10 +101,12 @@ complete -o nospace -o filenames -F _git_index_tab_completion $git_index_alias
# Cross-shell key bindings # Cross-shell key bindings
_bind(){ _bind(){
if [[ $shell == "zsh" ]]; then # zsh if [ -n "$1" ]; then
bindkey -s "$1" "$2" if [[ $shell == "zsh" ]]; then # zsh
else # bash bindkey -s "$1" "$2"
bind "\"$1\": \"$2\"" else # bash
bind "\"$1\": \"$2\""
fi
fi fi
} }