Typing "svn diff" or "hg diff" is not fun if you had to type it again, just to print the result with less. In addition, when it is likely that your text editor does syntax highlighting .. there is no reason why the output of diff in the terminal should also not be highlighted in appropriate colors.
alt text http://img25.imageshack.us/img25/8597/colordiff.png
You will need colordiff , which can be installed via apt or macports.
The following bash function will allow you to enter just `dif 'into the VCS working directory of your choice (no need to indicate whether it is hg or svn).
function dif { if [ -d .hg ]; then VC='hg' elif [ -d .svn ]; then VC='svn' else echo "cannot find VC type" return 1 fi $VC diff $1 | colordiff | less -R }
You cannot add support for other VCS tools (git, cvs, etc.)
Also, if you installed UVC (according to Ryan Wilcox's answer), the above script can be simplified as:
function dif { uvc diff $1 | colordiff | less -R }
source share