|
|
|
@ -40,7 +40,7 @@ function pmodload {
|
|
|
|
|
pmodules=("$argv[@]")
|
|
|
|
|
|
|
|
|
|
# Add functions to $fpath.
|
|
|
|
|
fpath=(${pmodules:+${ZDOTDIR:-$HOME}/.zprezto/modules/${^pmodules}/functions(/FN)} $fpath)
|
|
|
|
|
fpath=(${pmodules:+$PREZTO_HOME/modules/${^pmodules}/functions(/FN)} $fpath)
|
|
|
|
|
|
|
|
|
|
function {
|
|
|
|
|
local pfunction
|
|
|
|
@ -49,7 +49,7 @@ function pmodload {
|
|
|
|
|
setopt LOCAL_OPTIONS EXTENDED_GLOB
|
|
|
|
|
|
|
|
|
|
# Load Prezto functions.
|
|
|
|
|
for pfunction in ${ZDOTDIR:-$HOME}/.zprezto/modules/${^pmodules}/functions/$~pfunction_glob; do
|
|
|
|
|
for pfunction in $PREZTO_HOME/modules/${^pmodules}/functions/$~pfunction_glob; do
|
|
|
|
|
autoload -Uz "$pfunction"
|
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
@ -58,12 +58,12 @@ function pmodload {
|
|
|
|
|
for pmodule in "$pmodules[@]"; do
|
|
|
|
|
if zstyle -t ":prezto:module:$pmodule" loaded; then
|
|
|
|
|
continue
|
|
|
|
|
elif [[ ! -d "${ZDOTDIR:-$HOME}/.zprezto/modules/$pmodule" ]]; then
|
|
|
|
|
elif [[ ! -d "$PREZTO_HOME/modules/$pmodule" ]]; then
|
|
|
|
|
print "$0: no such module: $pmodule" >&2
|
|
|
|
|
continue
|
|
|
|
|
else
|
|
|
|
|
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/modules/$pmodule/init.zsh" ]]; then
|
|
|
|
|
source "${ZDOTDIR:-$HOME}/.zprezto/modules/$pmodule/init.zsh"
|
|
|
|
|
if [[ -s "$PREZTO_HOME/modules/$pmodule/init.zsh" ]]; then
|
|
|
|
|
source "$PREZTO_HOME/modules/$pmodule/init.zsh"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if (( $? == 0 )); then
|
|
|
|
@ -80,7 +80,7 @@ function pmodload {
|
|
|
|
|
setopt LOCAL_OPTIONS EXTENDED_GLOB
|
|
|
|
|
|
|
|
|
|
# Unload Prezto functions.
|
|
|
|
|
for pfunction in ${ZDOTDIR:-$HOME}/.zprezto/modules/$pmodule/functions/$~pfunction_glob; do
|
|
|
|
|
for pfunction in $PREZTO_HOME/modules/$pmodule/functions/$~pfunction_glob; do
|
|
|
|
|
unfunction "$pfunction"
|
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|