1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2024-12-23 03:27:59 +00:00

Use Git for coloured diff if colordiff is not installed.

This commit is contained in:
Sorin Ionescu 2011-07-14 16:19:00 -04:00
parent 7bf23fd6d2
commit 0ccc0c3fe6

View File

@ -63,11 +63,20 @@ fi
if [[ "$DISABLE_COLOR" != 'true' ]]; then
if [[ -x "${commands[colordiff]}" ]]; then
alias diff='colordiff'
alias diff='colordiff -u'
compdef colordiff=diff
elif [[ -x "${commands[git]}" ]]; then
function diff() {
git --no-pager diff --color=always --no-ext-diff --no-index "$@";
}
compdef _git diff=git-diff
else
alias diff='diff -u'
fi
if [[ -x "${commands[colormake]}" ]]; then
alias make='colormake'
compdef colormake=make
fi
fi