2012-06-03 18:16:47 +00:00
|
|
|
#
|
|
|
|
# Highlights diff output.
|
|
|
|
#
|
|
|
|
# Authors:
|
|
|
|
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
|
|
|
#
|
|
|
|
|
2012-06-03 21:53:02 +00:00
|
|
|
function diff {
|
2012-09-03 20:08:39 +00:00
|
|
|
if zstyle -t ':prezto:module:utility:diff' color; then
|
2012-06-03 18:16:47 +00:00
|
|
|
if (( $+commands[colordiff] )); then
|
2012-06-03 21:53:02 +00:00
|
|
|
command diff --unified "$@" | colordiff --difftype diffu
|
2012-06-03 18:16:47 +00:00
|
|
|
elif (( $+commands[git] )); then
|
|
|
|
git --no-pager diff --color=auto --no-ext-diff --no-index "$@"
|
2012-06-13 18:08:57 +00:00
|
|
|
else
|
|
|
|
command diff --unified "$@"
|
2012-06-03 18:16:47 +00:00
|
|
|
fi
|
2012-06-03 21:53:02 +00:00
|
|
|
else
|
|
|
|
command diff --unified "$@"
|
|
|
|
fi
|
|
|
|
}
|
2012-06-03 18:16:47 +00:00
|
|
|
|
2012-06-13 16:34:06 +00:00
|
|
|
diff "$@"
|