|
|
@ -91,12 +91,17 @@ if zstyle -t ':omz:alias:diff' color; then
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function wdiff() {
|
|
|
|
function wdiff() {
|
|
|
|
if (( $+commands[wdiff] )) && (( $+commands[colordiff] )); then
|
|
|
|
if (( $+commands[wdiff] )); then
|
|
|
|
"$commands[diff]" --unified "$@" | "$commands[wdiff]" --diff-input --avoid-wraps | colordiff --difftype wdiff
|
|
|
|
"$commands[wdiff]" \
|
|
|
|
|
|
|
|
--avoid-wraps \
|
|
|
|
|
|
|
|
--start-delete="$(print -n $FG[red])" \
|
|
|
|
|
|
|
|
--end-delete="$(print -n $FG[none])" \
|
|
|
|
|
|
|
|
--start-insert="$(print -n $FG[green])" \
|
|
|
|
|
|
|
|
--end-insert="$(print -n $FG[none])" \
|
|
|
|
|
|
|
|
"$@" \
|
|
|
|
|
|
|
|
| sed 's/^\(@@\( [+-][[:digit:]]*,[[:digit:]]*\)\{2\} @@\)$/;5;6m\10m/g'
|
|
|
|
elif (( $+commands[git] )); then
|
|
|
|
elif (( $+commands[git] )); then
|
|
|
|
git --no-pager diff --color=auto --no-ext-diff --no-index --word-diff "$@"
|
|
|
|
git --no-pager diff --color=auto --no-ext-diff --no-index --color-words "$@"
|
|
|
|
elif (( $+commands[wdiff] )); then
|
|
|
|
|
|
|
|
"$commands[diff]" --unified "$@" | "$commands[wdiff]" --diff-input --avoid-wraps
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
print "zsh: command not found: $0" >&2
|
|
|
|
print "zsh: command not found: $0" >&2
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|