From 5acbda2aeb8e334fe88b9e10cef5c04bb121aae4 Mon Sep 17 00:00:00 2001 From: nirenjan Date: Tue, 23 Oct 2018 22:21:19 -0700 Subject: [PATCH] Move alias for ls into lscolors.zsh Having the ls alias default to `ls --color=auto` caused it to break on OSX, since the version of ls that ships with OSX doesn't support the `--color` option. This change moves the alias into lscolors, since we already have a check for OSX vs non-OSX (in my case, Linux). This allows the alias to work as expected on Linux, while the environment variable LSCOLORS provides the coloring option on OSX. --- zsh/aliases.zsh | 1 - zsh/lscolors.zsh | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index e7126f1..08a3427 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -3,7 +3,6 @@ ####################################################################### # Common aliases across systems # ls aliases -alias ls='ls --color=auto' alias ll='ls -l' # Git aliases diff --git a/zsh/lscolors.zsh b/zsh/lscolors.zsh index 8b96ce8..f6d130d 100644 --- a/zsh/lscolors.zsh +++ b/zsh/lscolors.zsh @@ -39,6 +39,9 @@ then # Must use either CLICOLOR=1 or ls -G export CLICOLOR=1 +else + # On Unix, add an alias to display the color always + alias ls='ls --color=auto' fi DCFILE="$HOME/.dircolors"