|
@@ -9,7 +9,7 @@ if ! is-at-least 5.2; then
|
|
|
fi
|
|
|
|
|
|
# Define zim location
|
|
|
-ZIM="${ZDOTDIR:-${HOME}}/.zim"
|
|
|
+(( ! ${+ZIM_HOME} )) && ZIM_HOME="${ZDOTDIR:-${HOME}}/.zim"
|
|
|
|
|
|
# Source user configuration
|
|
|
if [[ -s "${ZDOTDIR:-${HOME}}/.zimrc" ]]; then
|
|
@@ -20,9 +20,9 @@ load_zim_module() {
|
|
|
local wanted_module
|
|
|
|
|
|
for wanted_module (${zmodules}); do
|
|
|
- if [[ -s "${ZIM}/modules/${wanted_module}/init.zsh" ]]; then
|
|
|
- source "${ZIM}/modules/${wanted_module}/init.zsh"
|
|
|
- elif [[ ! -d "${ZIM}/modules/${wanted_module}" ]]; then
|
|
|
+ if [[ -s "${ZIM_HOME}/modules/${wanted_module}/init.zsh" ]]; then
|
|
|
+ source "${ZIM_HOME}/modules/${wanted_module}/init.zsh"
|
|
|
+ elif [[ ! -d "${ZIM_HOME}/modules/${wanted_module}" ]]; then
|
|
|
print "No such module \"${wanted_module}\"." >&2
|
|
|
fi
|
|
|
done
|
|
@@ -33,12 +33,12 @@ load_zim_function() {
|
|
|
local mod_function
|
|
|
|
|
|
# autoload searches fpath for function locations; add enabled module function paths
|
|
|
- fpath=(${${zmodules}:+${ZIM}/modules/${^zmodules}/functions(/FN)} ${fpath})
|
|
|
+ fpath=(${${zmodules}:+${ZIM_HOME}/modules/${^zmodules}/functions(/FN)} ${fpath})
|
|
|
|
|
|
function {
|
|
|
setopt LOCAL_OPTIONS EXTENDED_GLOB
|
|
|
|
|
|
- for mod_function in ${ZIM}/modules/${^zmodules}/functions/${~function_glob}; do
|
|
|
+ for mod_function in ${ZIM_HOME}/modules/${^zmodules}/functions/${~function_glob}; do
|
|
|
autoload -Uz ${mod_function}
|
|
|
done
|
|
|
}
|