From 48c14ac3feecf7b1f3483bf65acdbf2f9d40c185 Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 18 Nov 2024 14:10:29 +0800 Subject: [PATCH] Add checks for direnv, and better bsd support --- .zshrc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.zshrc b/.zshrc index f687617..e40dbba 100644 --- a/.zshrc +++ b/.zshrc @@ -32,18 +32,22 @@ if ! command -v bat &> /dev/null ; then zinit light sharkdp/bat fi -zinit from"gh-r" as"program" mv"direnv* -> direnv" \ - atclone'./direnv hook zsh > zhook.zsh' atpull'%atclone' \ - pick"direnv" src="zhook.zsh" for \ - direnv/direnv +if ! command -v direnv &> /dev/null ; then + zinit from"gh-r" as"program" mv"direnv* -> direnv" \ + atclone'./direnv hook zsh > zhook.zsh' atpull'%atclone' \ + pick"direnv" src="zhook.zsh" for \ + direnv/direnv +fi autoload -Uz _zinit (( ${+_comps} )) && _comps[zinit]=_zinit -test -n "$LS_COLORS" || eval $(dircolors) || echo 'Warning: Unable to set LS_COLORS' +# Set ls colors for GNU/Linux, BSDs doesn't need this +if [[ $(uname) = "Linux" ]]; then + test -n "$LS_COLORS" || eval $(dircolors) || echo 'Warning: Unable to set LS_COLORS' +fi # The following lines were added by compinstall - zstyle ':completion:*' auto-description '%F{green}Specify%f: %F{cyan}%d%f' zstyle ':completion:*' completer _oldlist _expand _complete _ignored _match _correct _approximate _prefix zstyle ':completion:*' completions 1