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
_bind(){
if [[ $shell == "zsh" ]]; then # zsh
bindkey -s "$1" "$2"
else # bash
bind "\"$1\": \"$2\""
if [ -n "$1" ]; then
if [[ $shell == "zsh" ]]; then # zsh
bindkey -s "$1" "$2"
else # bash
bind "\"$1\": \"$2\""
fi
fi
}