Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Commit

Permalink
Use GNU ls on MacOS if available to have better colorization
Browse files Browse the repository at this point in the history
  • Loading branch information
weyhmueller committed Sep 1, 2013
1 parent e0f2c33 commit cc06371
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions modules/utility/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,21 @@ if is-callable 'dircolors'; then
# else
#alias ls="$aliases[ls] -F"
fi
elif is-callable 'gdircolors'; then
# have GNU Utils with g-prefix
if zstyle -t ':prezto:module:utility:ls' color; then
if [[ -s "$HOME/.dir_colors" ]]; then
# This is a precompiled dir_colors file
source "$HOME/.dir_colors"
elif [[ -s "$HOME/.dir_colors.txt" ]]; then
# This is a text file suitable for the dircolors tool
eval "$(gdircolors "$HOME/.dircolors.txt")"
else
# Fallback to some basic colors, even if they are ugly
eval "$(gdircolors)"
fi
alias ls='gls --color'
fi
else
# BSD Core Utilities
if zstyle -t ':prezto:module:utility:ls' color; then
Expand Down

0 comments on commit cc06371

Please sign in to comment.