From: Alexander Barton Date: Thu, 16 Jul 2015 22:38:18 +0000 (+0200) Subject: Add "40_path" plugin to initialize PATH and MANPATH X-Git-Url: https://arthur.barton.de/gitweb/?p=ax-zsh.git;a=commitdiff_plain;h=9bc85b470369c3e23d2c1d5bb0ec500df13ae5e7 Add "40_path" plugin to initialize PATH and MANPATH --- diff --git a/core/40_path/40_path.zprofile b/core/40_path/40_path.zprofile new file mode 100644 index 0000000..59f9b75 --- /dev/null +++ b/core/40_path/40_path.zprofile @@ -0,0 +1,29 @@ +# AX-ZSH: Alex' Modular ZSH Configuration +# 40_path.zprofile: Setup PATH environment + +# Set default PATH +export PATH="/usr/bin:/bin:/usr/sbin:/sbin" + +# Set default MANPATH +export MANPATH="$(manpath)" 2>/dev/null +if [[ $? -ne 0 ]]; then + MANPATH="/usr/share/man" + for d (/usr/local/share/man /opt/*/man(N)); do + [ -d "$d" ] && MANPATH="$MANPATH:$d" + done +fi + +# Prepend additional search paths +for d (/usr/local/bin /usr/local/sbin ~/Applications(N)); do + [ -d "$d" ] && PATH="$d:$PATH" +done + +# Append additional search paths +for d (/opt/*/sbin /opt/*/bin(N)); do + [ -d "$d" ] && PATH="$PATH:$d" +done + +if [[ -x /usr/libexec/path_helper ]]; then + # Update PATH using "path_helper(1)", when available + eval "$(/usr/libexec/path_helper)" +fi