mirror of
https://github.com/dcarrillo/prezto.git
synced 2024-12-23 00:17:59 +00:00
Rework diff function
This removes --unified from the default options to make it possible to pass -y without worrying about conflicting output formats. diffu has also been added as an alias to make it easier to get output as a unified diff. Fixes #1231
This commit is contained in:
parent
40853f23c2
commit
38f0d2f34e
@ -8,14 +8,12 @@
|
|||||||
function diff {
|
function diff {
|
||||||
if zstyle -t ':prezto:module:utility:diff' color; then
|
if zstyle -t ':prezto:module:utility:diff' color; then
|
||||||
if (( $+commands[colordiff] )); then
|
if (( $+commands[colordiff] )); then
|
||||||
command colordiff --unified "$@"
|
command colordiff "$@"
|
||||||
elif (( $+commands[git] )); then
|
|
||||||
git --no-pager diff --color=auto --no-ext-diff --no-index "$@"
|
|
||||||
else
|
else
|
||||||
command diff --unified "$@"
|
command diff "$@"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
command diff --unified "$@"
|
command diff "$@"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,6 +49,7 @@ alias sftp='noglob sftp'
|
|||||||
alias _='sudo'
|
alias _='sudo'
|
||||||
alias b='${(z)BROWSER}'
|
alias b='${(z)BROWSER}'
|
||||||
alias cp="${aliases[cp]:-cp} -i"
|
alias cp="${aliases[cp]:-cp} -i"
|
||||||
|
alias diffu="diff --unified"
|
||||||
alias e='${(z)VISUAL:-${(z)EDITOR}}'
|
alias e='${(z)VISUAL:-${(z)EDITOR}}'
|
||||||
alias ln="${aliases[ln]:-ln} -i"
|
alias ln="${aliases[ln]:-ln} -i"
|
||||||
alias mkdir="${aliases[mkdir]:-mkdir} -p"
|
alias mkdir="${aliases[mkdir]:-mkdir} -p"
|
||||||
|
Loading…
Reference in New Issue
Block a user