From 3f3fbd746fe00652e9438a94954ab062304e892b Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 27 Feb 2016 20:16:59 -0500 Subject: bash: add a colored chardiff alias --- .config/bash/rc.d/10_aliases.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.config/bash/rc.d/10_aliases.sh b/.config/bash/rc.d/10_aliases.sh index 03ece7e..1b25f93 100644 --- a/.config/bash/rc.d/10_aliases.sh +++ b/.config/bash/rc.d/10_aliases.sh @@ -24,7 +24,7 @@ if [ -x "`which dircolors`" ]; then if [[ -t 1 ]]; then local red="$(tput setaf 1)" local blue="$(tput setaf 4)" - local bold="$(tput bold)" + local bold="$(tput bold)" local reset="$(tput sgr0)" command wdiff \ -w "$bold$red[-" \ @@ -36,6 +36,22 @@ if [ -x "`which dircolors`" ]; then fi } + chardiff() { + if [[ -t 1 ]]; then + local red="$(tput setaf 1)" + local blue="$(tput setaf 4)" + local bold="$(tput bold)" + local reset="$(tput sgr0)" + command chardiff \ + -w "$bold$red[-" \ + -x "-]$reset" \ + -y "$bold$blue{+" \ + -z "+}$reset" "$@" + else + command chardiff "$@" + fi + } + diff() { if [[ -t 1 ]]; then ( -- cgit v1.2.3