export ZDOTDIR=${XDG_CONFIG_HOME:-~/.config}/zsh
-### load site-specific
-[[ -f ${ZDOTDIR:-~}/.zshenv.local ]] && source ${ZDOTDIR:-~}/.zshenv.local
-
### fix broken term
if [[ ! -v TERM ]] {
TERM=xterm-256color >/dev/null 2>&1
_sev_refresh_gpgagent=
[[ ! -o login ]] && source ${ZDOTDIR:-~}/.zprofile
} elif [[ ! -o login && $SHLVL -eq 1 && ${+TERMUX_VERSION} -eq 0 ]] {
- ### early zprofile sourcing for first shell even if not a login shell
+ ### early zprofile sourcing for first shell even if not a login shell,
+ ### since Termux does not start login shell as first process
source ${ZDOTDIR:-~}/.zprofile
}
# NOTE: all logic here moved to .zprofile, see comments there for rationale
### load site-specific
-if [[ -f ${ZDOTDIR:-~}/.zlogin.local ]] { source ${ZDOTDIR:-~}/.zlogin.local }
+load-site-dotfile zlogin
### cd for convenience
cd ${_sev_home:-~}
}
### load site-specific
-if [[ -f ${ZDOTDIR:-~}/.zlogout.local ]] { source ${ZDOTDIR:-~}/.zlogout.local }
+load-site-dotfile zlogout
unset x p y
}
-### lang
-export CHARSET=${CHARSET:-UTF-8}
-export LANG=${LANG:-en_US.UTF-8}
-
### path
# NOTE: we utilize the fact that unique arrays keep the first occurrence and
# remove any further occurences to capture elements from the old PATH
export _sev_setup_path=
}
+### autoload to load site specific dotfiles now that fpath is set
+autoload -Uz load-site-dotfile
+
+### load zshenv site-specific
+# NOTE: this has to be here since fpath isn't set in .zshenv
+load-site-dotfile zshenv
+
+### lang
+export CHARSET=${CHARSET:-UTF-8}
+export LANG=${LANG:-en_US.UTF-8}
+
### xdg local dir
# NOTE: need this for tmp, so confirm it exists.
# XXX: perms are not specified for XDG dirs except runtime, but I think 760
### load site-specific
-if [[ -f ${ZDOTDIR:-~}/.zprofile.local ]] { source ${ZDOTDIR:-~}/.zprofile.local }
+load-site-dotfile zprofile
prompt arrows
### load site-specific
-if [[ -f ${ZDOTDIR:-~}/.zshrc.local ]] { source ${ZDOTDIR:-~}/.zshrc.local }
+load-site-dotfile zshrc
--- /dev/null
+# load site-specific dotfiles
+
+emulate -L zsh
+
+local x p
+typeset -aU p
+p=({${ZDOTDIR:-~},~}/{.,}${1#.}.local)
+for x ($p) {
+ [[ -f $x ]] && source $x
+}