Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/github/pr/55'
Browse files Browse the repository at this point in the history
  • Loading branch information
mika committed May 25, 2018
2 parents dcba02c + 1fa194e commit a5eb2fe
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions etc/zsh/zshrc
Expand Up @@ -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
Expand Down

0 comments on commit a5eb2fe

Please sign in to comment.