From 93753815c22df73e4eaf2acacbc031ca77f7d067 Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Sun, 3 Mar 2013 15:53:40 -0600 Subject: [PATCH] .bashrc: Alias diff="git diff --no-index" Use "git diff --no-index" as a prettier "diff" alternative (if available) since it supports nice colored output (via .gitconfig). --- .bashrc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.bashrc b/.bashrc index 144303d..891f80c 100644 --- a/.bashrc +++ b/.bashrc @@ -232,6 +232,15 @@ fi # ALIASES / FUNCTIONS # ---------------------------------------------------------------------- +# 'ls' helpers +alias ll="ls -l" +alias l.="ls -d .*" +alias ll.="ls -ld .*" +alias lla="ls -la" + +# use 'git diff --no-index' as a prettier 'diff' alternative (if available) +test -n "$(type -P git)" && alias diff="git diff --no-index" + # alias 'vi' to 'vim' if Vim is installed vim="$(type -P vim)" test -n "$vim" && { @@ -312,12 +321,6 @@ test -n "$COLORS" && test -n "$LS_COMMON" && alias ls="command ls $LS_COMMON" -# these use the ls aliases above -alias ll="ls -l" -alias l.="ls -d .*" -alias ll.="ls -ld .*" -alias lla="ls -la" - # setup color grep output if available if [ -n "$COLORS" ]; then case "$UNAME" in -- 2.43.0