|
|
|
@ -1,3 +1,4 @@
|
|
|
|
|
#!/usr/bin/env zsh
|
|
|
|
|
#
|
|
|
|
|
# Initializes Prezto.
|
|
|
|
|
#
|
|
|
|
@ -31,7 +32,7 @@ function pmodload {
|
|
|
|
|
pmodules=("$argv[@]")
|
|
|
|
|
|
|
|
|
|
# Add functions to $fpath.
|
|
|
|
|
fpath=(${pmodules:+${ZDOTDIR:-$HOME}/.zprezto/modules/${^pmodules}/functions(/FN)} $fpath)
|
|
|
|
|
fpath=(${pmodules:+$DOTFILES/zprezto/modules/${^pmodules}/functions(/FN)} $fpath)
|
|
|
|
|
|
|
|
|
|
function {
|
|
|
|
|
local pfunction
|
|
|
|
@ -40,7 +41,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 $DOTFILES/zprezto/modules/${^pmodules}/functions/$~pfunction_glob; do
|
|
|
|
|
autoload -Uz "$pfunction"
|
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
@ -49,19 +50,19 @@ function pmodload {
|
|
|
|
|
for pmodule in "$pmodules[@]"; do
|
|
|
|
|
if zstyle -t ":prezto:module:$pmodule" loaded 'yes' 'no'; then
|
|
|
|
|
continue
|
|
|
|
|
elif [[ ! -d "${ZDOTDIR:-$HOME}/.zprezto/modules/$pmodule" ]]; then
|
|
|
|
|
elif [[ ! -d "$DOTFILES/zprezto/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 "$DOTFILES/zprezto/modules/$pmodule/init.zsh" ]]; then
|
|
|
|
|
source "$DOTFILES/zprezto/modules/$pmodule/init.zsh"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if (( $? == 0 )); then
|
|
|
|
|
zstyle ":prezto:module:$pmodule" loaded 'yes'
|
|
|
|
|
else
|
|
|
|
|
# Remove the $fpath entry.
|
|
|
|
|
fpath[(r)${ZDOTDIR:-$HOME}/.zprezto/modules/${pmodule}/functions]=()
|
|
|
|
|
fpath[(r)$DOTFILES/zprezto/modules/${pmodule}/functions]=()
|
|
|
|
|
|
|
|
|
|
function {
|
|
|
|
|
local pfunction
|
|
|
|
@ -71,7 +72,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 $DOTFILES/zprezto/modules/$pmodule/functions/$~pfunction_glob; do
|
|
|
|
|
unfunction "$pfunction"
|
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|