aboutsummaryrefslogtreecommitdiff
path: root/zsh/appearance.zsh
diff options
context:
space:
mode:
authorMatt Singleton <matthew.j.singleton@gmail.com>2011-04-02 01:00:17 -0400
committerMatt Singleton <matthew.j.singleton@gmail.com>2011-04-02 01:00:17 -0400
commitea0f718e32d1a25da7ecc6e42b70e501f152c99f (patch)
treee411d690ff09ada8090d4a5c28550519895a3113 /zsh/appearance.zsh
parentb572c615c26a0a1361d9be5e1934216e5a8ea883 (diff)
better ls colors and always use gnu ls if it's installed
Diffstat (limited to 'zsh/appearance.zsh')
-rw-r--r--zsh/appearance.zsh17
1 files changed, 12 insertions, 5 deletions
diff --git a/zsh/appearance.zsh b/zsh/appearance.zsh
index 04d270f..84d8471 100644
--- a/zsh/appearance.zsh
+++ b/zsh/appearance.zsh
@@ -2,12 +2,19 @@
# colorize shell programs
# ls (platform dependent)
-if $(ls --color -d . &>/dev/null 2>&1); then
- alias ls='ls --color=tty'
- export LS_COLORS="di=34;40:ln=36;40:so=31;40:pi=33;40:ex=32;40:bd=34;46:cd=34;43:su=0;41:sg=0;46:tw=0;42:ow=0;43:"
+if [ -e /usr/local/bin/gls ]; then
+ # if GNU ls is installed (e.g. on BSD), use it
+ alias ls='/usr/local/bin/gls --color=tty'
+ export LS_COLORS="rs=0:di=34:ln=36:mh=00:pi=40;33:so=35:do=35:bd=40;33:cd=40;33:or=40;31:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=32"
else
- alias ls='ls -G'
- export LSCOLORS="exgxbxdxcxegedxbxgxcxd"
+ # otherwise, detect which version of ls is on the path
+ if $(ls --color -d . &>/dev/null 2>&1); then
+ alias ls='ls --color=tty'
+ export LS_COLORS="rs=0:di=34:ln=36:mh=00:pi=40;33:so=35:do=35:bd=40;33:cd=40;33:or=40;31:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=32"
+ else
+ alias ls='ls -G'
+ export LSCOLORS="exgxbxdxcxegedxbxgxcxd"
+ fi
fi
# grep