diff --git a/alias.zsh b/alias.zsh index 5408b9f0..8194a7e0 100644 --- a/alias.zsh +++ b/alias.zsh @@ -8,14 +8,25 @@ setopt CORRECT # Correct commands. # The 'ls' Family -if zstyle -t ':omz:alias:ls' color; then - if [[ -f "$HOME/.dir_colors" ]] && (( $+commands[dircolors] )); then - eval $(dircolors "$HOME/.dir_colors") - alias ls='ls -hF --group-directories-first --color=auto' +if (( $+commands[dircolors] )); then + # GNU core utilities. + alias ls='ls --group-directories-first' + + if zstyle -t ':omz:alias:ls' color; then + if [[ -f "$HOME/.dir_colors" ]]; then + eval $(dircolors "$HOME/.dir_colors") + fi + alias ls="$aliases[ls] --color=auto" else - export CLICOLOR=1 + alias ls="$aliases[ls] -F" + fi +else + # BSD core utilities. + if zstyle -t ':omz:alias:ls' color; then export LSCOLORS="exfxcxdxbxegedabagacad" - alias ls='ls -G -F' + alias ls="ls -G" + else + alias ls='ls -F' fi fi diff --git a/plugins/gnu-utils/init.zsh b/plugins/gnu-utils/init.zsh index 8c6ca6a6..e1318d76 100644 --- a/plugins/gnu-utils/init.zsh +++ b/plugins/gnu-utils/init.zsh @@ -60,11 +60,15 @@ if (( $+commands[gdircolors] )); then } # A sensible default for ls. - if zstyle -t ':omz:alias:ls' color && [[ -f "$HOME/.dir_colors" ]]; then - eval $(gdircolors "$HOME/.dir_colors") - alias ls='ls -hF --group-directories-first --color=auto' + alias ls='ls --group-directories-first' + + if zstyle -t ':omz:alias:ls' color; then + if [[ -f "$HOME/.dir_colors" ]]; then + eval $(gdircolors "$HOME/.dir_colors") + fi + alias ls="$aliases[ls] --color=auto" else - alias ls='ls -hF --group-directories-first' + alias ls="$aliases[ls] -F" fi fi