Browse Source

zsh: support macos ls

Thomas Dy 5 days ago
parent
commit
77fb727f76
1 changed files with 6 additions and 1 deletions
  1. 6 1
      .zsh/config.zsh

+ 6 - 1
.zsh/config.zsh

@@ -1,7 +1,12 @@
 if [ -f ~/.dircolors ]; then
   eval $(dircolors ~/.dircolors)
 fi
-alias ls="ls --color=auto --group-directories-first -F --quoting-style literal"
+
+if ls --group-directories-first $HOME > /dev/null 2>&1; then
+  alias ls="ls --color=auto --group-directories-first -F --quoting-style literal"
+else
+  alias ls="ls --color=auto -F"
+fi
 
 if whence -p yadm > /dev/null; then
   export YADM_OVERRIDE_REPO="$HOME/.dotfiles"