From e95b7cf4314c7c06add3e398073c9815a9ecd06f Mon Sep 17 00:00:00 2001 From: Charles Danesi Date: Mon, 28 Oct 2024 15:51:23 -0400 Subject: [PATCH] refactor dircolors --- .zshrc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.zshrc b/.zshrc index 27c0661..47e0be3 100644 --- a/.zshrc +++ b/.zshrc @@ -71,11 +71,15 @@ if [[ "$OSTYPE" =~ ^linux ]]; then fi # set up dircolors -if [ $(uname -s) = 'Darwin' ]; then - [[ ! -f $(which gdircolors) ]] || $(test -f $HOME/.dir_colors && eval $(gdircolors $HOME/.dir_colors) || eval $(gdircolors)) -else - test -f $HOME/.dir_colors && eval $(dircolors -b $HOME/.dir_colors) || eval $(dircolors -b) -fi +case $(uname -s) in + Darwin) + [[ ! -f $(which gdircolors) ]] || $(test -f $HOME/.dir_colors && eval $(gdircolors $HOME/.dir_colors) || eval $(gdircolors)) + ;; + Linux) + test -f $HOME/.dir_colors && eval $(dircolors -b $HOME/.dir_colors) || eval $(dircolors -b) + ;; + *) ;; +esac # Fix ctrl+r [[ ! -f $ZSH/custom/plugins/zsh-vi-mode/zsh-vi-mode.plugin.zsh ]] || source $ZSH/custom/plugins/zsh-vi-mode/zsh-vi-mode.plugin.zsh