summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-02-27 20:16:59 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-02-27 20:20:08 -0500
commit3f3fbd746fe00652e9438a94954ab062304e892b (patch)
tree91ede2643c8c2651d2fc2577d13dfea70ff41af5
parente328e6bf6f1f30be59297d2b49947adf6ff10d2c (diff)
bash: add a colored chardiff alias
-rw-r--r--.config/bash/rc.d/10_aliases.sh18
1 files changed, 17 insertions, 1 deletions
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
(