colordiff.
authorIain Patterson <me@iain.cx>
Tue, 4 Aug 2009 14:54:40 +0000 (15:54 +0100)
committerIain Patterson <me@iain.cx>
Tue, 4 Aug 2009 16:25:47 +0000 (17:25 +0100)
.colordiffrc [new file with mode: 0644]
.profile.d/diff.bashrc [new file with mode: 0644]
.profile.d/p4.bashrc

diff --git a/.colordiffrc b/.colordiffrc
new file mode 100644 (file)
index 0000000..f40430a
--- /dev/null
@@ -0,0 +1,5 @@
+plain=normal
+newtext=darkcyan
+oldtext=darkred
+diffstuff=darkyellow
+cvsstuff=darkgreen
diff --git a/.profile.d/diff.bashrc b/.profile.d/diff.bashrc
new file mode 100644 (file)
index 0000000..af307ce
--- /dev/null
@@ -0,0 +1,5 @@
+colordiff=$(find_working colordiff 2>/dev/null)
+if [ $? = 0 ]; then
+  alias diff="$colordiff"
+fi
+unset colordiff
index 93627f1..94cd19c 100644 (file)
@@ -5,7 +5,8 @@ else
   export P4USER=$USER
 fi
 export P4CONFIG=.p4config
-export P4DIFF="diff -u"
+eval $(alias diff 2>/dev/null | sed 's/^alias diff/P4DIFF/')
+export P4DIFF="${P4DIFF:-diff} -u"
 if [ -e "$HOME/.vim/script/p4" ]; then
   export P4EDITOR="vim -S '$HOME/.vim/script/p4'"
 else