diff --git a/zshrc b/zshrc index 872b6d1..a0b5248 100644 --- a/zshrc +++ b/zshrc @@ -210,10 +210,11 @@ if which fossil &>/dev/null; then if which colordiff &>/dev/null; then fossil diff -N "$@" | colordiff | less -FRX else - fossil diff -N "$@" | - sed "s/^+.*$/$(tput setaf 2)&$(tput sgr0)/" | - sed "s/^-.*$/$(tput setaf 1)&$(tput sgr0)/" | - less -FRX + red="$(tput setaf 1)" + green="$(tput setaf 2)" + reset="$(tput sgr0)" + fossil diff -N "$@" | sed "s/^+.*$/$green&$reset/" | + sed "s/^-.*$/$red&$reset/" | less -FRX fi } fi