From 489ebf1a7111c7d934e5ab6e326e63a180b461ed Mon Sep 17 00:00:00 2001 From: 10sr Date: Sat, 5 Nov 2011 20:39:16 +0900 Subject: [PATCH] add function di --- .bashrc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.bashrc b/.bashrc index ef57948..02253e5 100755 --- a/.bashrc +++ b/.bashrc @@ -38,9 +38,18 @@ alias xunp="file-roller -h" alias pacome="sudo \paco -D" alias destroy="rm -rf" alias psall="ps auxww" -alias diff="$(type colordiff >/dev/null 2>&1 && test $TERM != dumb && echo color)diff -u" +# alias diff="$(type colordiff >/dev/null 2>&1 && test $TERM != dumb && echo color)diff -u" # type trash >/dev/null 2>&1 && alias rm=trash +di(){ + if type colordiff >/dev/null 2>&1 && test $TERM != dumb + then + local diffcmd=colordiff + else + local diffcmd=diff + fi + ${diffcmd} -u "$@" | ${PAGER} +} memo(){ _MEMO="# $*\n" } @@ -151,7 +160,7 @@ _mygitconfig(){ git config --global color.ui auto git config --global status.relativePaths false git config --global status.showUntrackedFiles no - git config --global alias.graph "log --graph --date-order -C -M --pretty=format:\"<%h> %ad [%an] %Cgreen%d%Creset %s\" --all --date=short --stat" + git config --global alias.graph "log --graph --date-order -C -M --pretty=format:\"<%h> %ad [%an] %Cgreen%d%Creset %s\" --all --date=short" git config --global alias.st "status" git config --global alias.b "branch" git config --global alias.ci "commit --verbose" @@ -252,7 +261,7 @@ iswindows(){ } ismsys(){ - return 1 + false } iscygwin(){