projects
/
grml-etc-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
zshrc: Add comments about the ls_ and grep_options we set
[grml-etc-core.git]
/
etc
/
zsh
/
zshrc
diff --git
a/etc/zsh/zshrc
b/etc/zsh/zshrc
index
451b5dd
..
afcb5b7
100644
(file)
--- a/
etc/zsh/zshrc
+++ b/
etc/zsh/zshrc
@@
-431,8
+431,11
@@
ZSH_NO_DEFAULT_LOCALE=${ZSH_NO_DEFAULT_LOCALE:-0}
typeset -ga ls_options
typeset -ga grep_options
typeset -ga ls_options
typeset -ga grep_options
+
+# Colors on GNU ls(1)
if ls --color=auto / >/dev/null 2>&1; then
ls_options+=( --color=auto )
if ls --color=auto / >/dev/null 2>&1; then
ls_options+=( --color=auto )
+# Colors on FreeBSD and OSX ls(1)
elif ls -G / >/dev/null 2>&1; then
ls_options+=( -G )
fi
elif ls -G / >/dev/null 2>&1; then
ls_options+=( -G )
fi
@@
-442,6
+445,7
@@
if ls -v / >/dev/null 2>&1; then
ls_options+=( -v )
fi
ls_options+=( -v )
fi
+# Color on GNU and FreeBSD grep(1)
if grep --color=auto -q "a" <<< "a" >/dev/null 2>&1; then
grep_options+=( --color=auto )
fi
if grep --color=auto -q "a" <<< "a" >/dev/null 2>&1; then
grep_options+=( --color=auto )
fi