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,11 +101,13 @@ complete -o nospace -o filenames -F _git_index_tab_completion $git_index_alias
# Cross-shell key bindings # Cross-shell key bindings
_bind(){ _bind(){
if [ -n "$1" ]; then
if [[ $shell == "zsh" ]]; then # zsh if [[ $shell == "zsh" ]]; then # zsh
bindkey -s "$1" "$2" bindkey -s "$1" "$2"
else # bash else # bash
bind "\"$1\": \"$2\"" bind "\"$1\": \"$2\""
fi fi
fi
} }
case "$TERM" in case "$TERM" in