From 2091605c1623b30c4e12688f6939524e239d0c11 Mon Sep 17 00:00:00 2001 From: Patrick Simianer
Date: Sat, 21 Feb 2015 19:53:41 +0100 Subject: zsh: check whether host has 'colordiff' --- .zshrc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.zshrc b/.zshrc index 60509f8..4164e28 100644 --- a/.zshrc +++ b/.zshrc @@ -153,7 +153,6 @@ alias updatedb='sudo updatedb' alias qmv='qmv -evim -fdo' alias dusage='du -hs *' alias df='df -h' -alias diff='colordiff' alias iwlist='sudo iwlist wlan0 scan' alias fumount='fusermount -u' alias more='less' @@ -182,6 +181,7 @@ alias always_on='xset dpms 0 0 0' alias quotes='curl -s "http://download.finance.yahoo.com/d/quotes.csv?s=AAPL+AMD+GOOG&f=l1"' alias irb='pry' alias watch_d='while true; do clear; ps ax | grep -P "\sD\+?\s"; sleep 5; done' +alias easy_install_home='easy_install --install-dir=$HOME/lib/python/site-packages' if [[ -f ~/.zshrcp ]]; then source ~/.zshrcp fi @@ -205,3 +205,11 @@ esac stty -ixon # enable mapping of C-s in vim.. +diff () { + if hash colordiff 2>/dev/null; then + colordiff "$@" + else + diff "$@" + fi +} + -- cgit v1.2.3