From 37f14fc23a48a6cb95f6330e0fbd10372fd02680 Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Fri, 21 Oct 2022 20:16:10 +0200 Subject: [PATCH] zsh: make `~/.zshenv' as small as possible `~/.zshenv' is executed for _every_ instance of `zsh', so we should limit the work done there to the absolute minimum. For me, that currently means only making sure `$ZDOTDIR' is set so that login (via `.zprofile') and interactive (via `.zshrc') shells can be configured appropriately. --- config/zsh/.zprofile | 4 ++++ home/.zshenv | 9 ++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/config/zsh/.zprofile b/config/zsh/.zprofile index 8c8d3b7..59b431d 100644 --- a/config/zsh/.zprofile +++ b/config/zsh/.zprofile @@ -1,3 +1,7 @@ +export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" +export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" +export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" + export LANG="en_US.UTF-8" export LANGUAGE="en_US" export LC_ALL="en_US.UTF-8" diff --git a/home/.zshenv b/home/.zshenv index 5b74a51..a5b851f 100644 --- a/home/.zshenv +++ b/home/.zshenv @@ -1,8 +1,3 @@ -# Keep things organized. -export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" -export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" -export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" - -# Everything else will be configured from within $ZDOTDIR. -export ZDOTDIR="${ZDOTDIR:-$XDG_CONFIG_HOME/zsh}" +# Just find $ZDOTDIR here, everythng will be configured there. +export ZDOTDIR="${ZDOTDIR:-${XDG_CONFIG_HOME:-$HOME/.config}/zsh}"