X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fzshrc;h=a09361cde054c29544c71112c6e22eafeb5bf2f8;hb=1fa194ecab5c43405e800d81f1f6ba5e1fa68049;hp=c021c87db201905c6accc5a41127b816f79568f7;hpb=ea0e7e8f8398b56acfc3988255df57efc29aa65d;p=grml-etc-core.git diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index c021c87..a09361c 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -431,11 +431,22 @@ ZSH_NO_DEFAULT_LOCALE=${ZSH_NO_DEFAULT_LOCALE:-0} 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 ) +# Colors on FreeBSD and OSX ls(1) elif ls -G / >/dev/null 2>&1; then ls_options+=( -G ) fi + +# Natural sorting order on GNU ls(1) +# OSX and IllumOS have a -v option that is not natural sorting +if ls --version |& grep -q 'GNU' >/dev/null 2>&1 && ls -v / >/dev/null 2>&1; then + 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