ADDED fish/functions/cvsd.fish Index: fish/functions/cvsd.fish ================================================================== --- fish/functions/cvsd.fish +++ fish/functions/cvsd.fish @@ -0,0 +1,11 @@ +function cvsd --wraps 'cvs diff' + if type -q colordiff + command cvs diff -uN $argv | colordiff | less -FRX + else + set -l red (tput setaf 1) + set -l green (tput setaf 2) + set -l reset (tput sgr0) + cvs diff -uN $argv | sed "s/^+.*\$/$green&$reset/" | + sed "s/^-.*\$/$red&$reset/" | less -FRX + end +end Index: fish/functions/fld.fish ================================================================== --- fish/functions/fld.fish +++ fish/functions/fld.fish @@ -1,11 +1,11 @@ function fld --wraps 'fossil diff' - if type -q colordiff2 + if type -q colordiff command fossil diff -N $argv | colordiff | less -FRX else set -l red (tput setaf 1) set -l green (tput setaf 2) set -l reset (tput sgr0) fossil diff -N $argv | sed "s/^+.*\$/$green&$reset/" | sed "s/^-.*\$/$red&$reset/" | less -FRX end end Index: zshrc ================================================================== --- zshrc +++ zshrc @@ -296,10 +296,24 @@ LC_ALL=C git fast-import \ --export-marks=$gitdir/git.marks \ $=importmarks_git } fi + +if which cvs &>/dev/null; then + cvsd() { + if which colordiff &>/dev/null; then + cvs diff -uN "$@" | colordiff | less -FRX + else + red="$(tput setaf 1)" + green="$(tput setaf 2)" + reset="$(tput sgr0)" + cvs diff -uN "$@" | sed "s/^+.*$/$green&$reset/" | + sed "s/^-.*$/$red&$reset/" | less -FRX + fi + } +fi # pkgsrc does not like MAKEFLAGS including -j which pkg_chk &>/dev/null && alias pkg_chk="MAKEFLAGS= pkg_chk" which pkg_rolling-replace &>/dev/null && alias pkg_rolling-replace="MAKEFLAGS= pkg_rolling-replace"