diff options
Diffstat (limited to '.config/bash/rc.d/10_aliases.sh')
-rw-r--r-- | .config/bash/rc.d/10_aliases.sh | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/.config/bash/rc.d/10_aliases.sh b/.config/bash/rc.d/10_aliases.sh index 9d008e2..233be06 100644 --- a/.config/bash/rc.d/10_aliases.sh +++ b/.config/bash/rc.d/10_aliases.sh @@ -26,16 +26,12 @@ if type dircolors &>/dev/null; then done unset xgrep + alias diff='diff --color=auto' + wdiff() { if [[ -t 1 ]]; then local old new off - if type colordiff &>/dev/null; then - eval "$(colordiff <(echo old) <(echo new)|sed -rn 's@(.*)[<>] (old|new)(.*)@\2='\''\1'\''\noff='\''\3'\''\n@p')" - else - new="$(tput setaf 2)" - old="$(tput setaf 1)" - off="$(tput sgr0)" - fi + eval "$(diff --color=always <(echo old) <(echo new)|sed -rn 's@(.*)[<>] (old|new)(.*)@\2='\''\1'\''\noff='\''\3'\''\n@p')" command wdiff \ -w "$old[-" \ -x "-]$off" \ @@ -50,13 +46,7 @@ if type dircolors &>/dev/null; then chardiff() { if [[ -t 1 ]]; then local old new off - if type colordiff &>/dev/null; then - eval "$(colordiff <(echo old) <(echo new)|sed -rn 's@(.*)[<>] (old|new)(.*)@\2='\''\1'\''\noff='\''\3'\''\n@p')" - else - new="$(tput setaf 2)" - old="$(tput setaf 1)" - off="$(tput sgr0)" - fi + eval "$(diff --color=always <(echo old) <(echo new)|sed -rn 's@(.*)[<>] (old|new)(.*)@\2='\''\1'\''\noff='\''\3'\''\n@p')" command chardiff \ -w "$old[-" \ -x "-]$off" \ @@ -68,17 +58,6 @@ if type dircolors &>/dev/null; then fi } - diff() { - if [[ -t 1 ]] && type colordiff &>/dev/null; then - ( - set -o pipefail - command diff "$@" | colordiff - ) - else - command diff "$@" - fi - } - diffstat() { if [[ -t 1 ]]; then command diffstat -C "$@" |