From 4d99a78332f3c5b9985386629cb38c78dc50b398 Mon Sep 17 00:00:00 2001 From: Alen Date: Sat, 23 Sep 2023 23:12:48 +0400 Subject: Add more complete {,MAN,INFO}PATH setup and backup --- dot_zshenv | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'dot_zshenv') diff --git a/dot_zshenv b/dot_zshenv index 27779ba..df0f06e 100644 --- a/dot_zshenv +++ b/dot_zshenv @@ -41,13 +41,21 @@ export LC_ALL=en_US.UTF-8 export LESS="--RAW-CONTROL-CHARS --chop-long-lines --mouse" export PAGER="less" -# Add user's bin or .local/bin to PATH, if they exist -if [[ -d "${HOME}/bin" ]]; then - PATH="${HOME}/bin:${PATH}" -fi -if [[ -d "${HOME}/.local/bin" ]]; then - PATH="${HOME}/.local/bin:${PATH}" -fi +# Add ~/.local paths to {,MAN,INFO}PATH and fpath +export PATH="${HOME}/.local/bin${PATH:+:${PATH}}" +export MANPATH="${XDG_DATA_HOME:-${HOME}/.local/share}/man${MANPATH:+:${MANPATH}}" +export INFOPATH="${XDG_DATA_HOME:-${HOME}/.local/share}/info${INFOPATH:+:${INFOPATH}}" +fpath=( + "${ZDOTDIR:-${HOME}/.config/zsh}/functions" + "${XDG_DATA_HOME:-${HOME}/.local/share}/zsh/site-functions" + $fpath +) + +# Back these up as they could get mangled in system profile +# TODO: Restore them in zshrc? +export $__PATH="${PATH}" +export $__MANPATH="${MANPATH}" +export $__INFOPATH="${INFOPATH}" # Never allow global pip export PIP_REQUIRE_VENV=1 -- cgit 1.4.1-2-gfad0