From ec41e37b4b487bc0709e0ed324186a2146ba6dd5 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sun, 3 May 2020 13:12:46 -0500 Subject: [PATCH] Add .zshenv `.zshenv` is read for all shells, interactive or not, making it the best place to set variables that always apply. Unfortunately, it cannot be kept in `ZDOTDIR`, since that variable has to be set in that same script. To work around this, the "real" `.zshenv` can source the one in `ZDOTDIR`. --- .zprofile | 6 ------ .zshenv | 6 ++++++ README | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 .zprofile create mode 100644 .zshenv diff --git a/.zprofile b/.zprofile deleted file mode 100644 index 9138ab8..0000000 --- a/.zprofile +++ /dev/null @@ -1,6 +0,0 @@ -typeset -U path -path[1,0]=~/.local/bin - -if [[ -r ${ZDOTDIR:-${HOME}}/.zprofile.local ]]; then - . ${ZDOTDIR:-${HOME}}/.zprofile.local -fi diff --git a/.zshenv b/.zshenv new file mode 100644 index 0000000..80633d8 --- /dev/null +++ b/.zshenv @@ -0,0 +1,6 @@ +export EDITOR=vim + +typeset -U path +path[1,0]=~/.npm/bin +path[1,0]=~/.cargo/bin +path[1,0]=~/.local/bin diff --git a/README b/README index 5f6be63..5df1394 100644 --- a/README +++ b/README @@ -1,4 +1,5 @@ -Add this line to ~/.zshenv in order to use these ZSH configuration files +Add these lines to ~/.zshenv in order to use these ZSH configuration files without copying/linking them to the "standard" paths: export ZDOTDIR=${HOME}/.zsh + source ${ZDOTDIR}/.zshenv