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