This allows you to set/override the ZDOTDIR environment variable in your
~/.zshenv file to have different "sets" of AX-ZSH configurations in
different ZDOTDIR folders. For example, for different terminal emulator
applications, system architectures or hosts.
If ZDOTDIR is not set, $HOME is used (so no functional changes when the
ZDOTDIR environment variable is not set).
[[ -n "$SHELL" ]] || export SHELL=$(command -v zsh)
# Make sure that "AXZSH" variable is set and exported
-[[ -n "$AXZSH" ]] || export AXZSH="$HOME/.axzsh"
+[[ -n "$AXZSH" ]] || export AXZSH="${ZDOTDIR:-$HOME}/.axzsh"
# Check for "debug mode" ...
if [[ -f "$AXZSH/debug" || -f "$HOME/.axzsh.debug" ]]; then
umask 027
-[ -n "$AXZSH" ] || AXZSH="$HOME/.axzsh"
+[ -n "$AXZSH" ] || AXZSH="${ZDOTDIR:-$HOME}/.axzsh"
export AXZSH
S=$(dirname "$0")
ax_msg - "Linking ZSH startup files ..."
-for f in ~/.zlogin ~/.zlogout ~/.zprofile ~/.zshrc; do
+for f in \
+ ${ZDOTDIR:-$HOME}/.zlogin \
+ ${ZDOTDIR:-$HOME}/.zlogout \
+ ${ZDOTDIR:-$HOME}/.zprofile \
+ ${ZDOTDIR:-$HOME}/.zshrc \
+; do
safe_rm "$f" || abort
ln -sv "$AXZSH/ax.zsh" "$f" || abort
done