Updated Plugin Loading
This commit is contained in:
parent
56b61e211d
commit
6c0f899c16
2 changed files with 28 additions and 9 deletions
18
init.zsh
18
init.zsh
|
@ -30,12 +30,20 @@ fi
|
|||
# Initialize modules
|
||||
() {
|
||||
local zmodule
|
||||
|
||||
for zmodule (${zmodules}); do
|
||||
if [[ -s ${ZIM_HOME}/modules/${zmodule}/init.zsh ]]; then
|
||||
source ${ZIM_HOME}/modules/${zmodule}/init.zsh
|
||||
elif [[ ! -d ${ZIM_HOME}/modules/${zmodule} ]]; then
|
||||
local zmodule_dir=${ZIM_HOME}/modules/${zmodule}
|
||||
if [[ ! -d ${zmodule_dir} ]]; then
|
||||
print "No such module \"${zmodule}\"." >&2
|
||||
else
|
||||
for zmodule_file (${zmodule_dir}/{,zsh-}${zmodule}.zsh-theme \
|
||||
${zmodule_dir}/init.zsh \
|
||||
${zmodule_dir}/{,zsh-}${zmodule}.plugin.zsh \
|
||||
${zmodule_dir}/{,zsh-}${zmodule}.{z,}sh); do
|
||||
if [[ -f ${zmodule_file} ]]; then
|
||||
source ${zmodule_file}
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
@ -78,4 +86,4 @@ Actions:
|
|||
*) print ${usage}; return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
}
|
|
@ -24,10 +24,21 @@
|
|||
done
|
||||
|
||||
# zcompile enabled module init scripts
|
||||
for file in ${ZIM_HOME}/modules/${^zmodules}/init.zsh(-.N); do
|
||||
zrecompile -pq ${file}
|
||||
local zmodule
|
||||
for zmodule (${zmodules}); do
|
||||
local zmodule_dir=${ZIM_HOME}/modules/${zmodule}
|
||||
if [[ -d ${zmodule_dir} ]]; then
|
||||
for zmodule_file (${zmodule_dir}/{,zsh-}${zmodule}.zsh-theme \
|
||||
${zmodule_dir}/init.zsh \
|
||||
${zmodule_dir}/{,zsh-}${zmodule}.plugin.zsh \
|
||||
${zmodule_dir}/{,zsh-}${zmodule}.{z,}sh); do
|
||||
if [[ -f ${zmodule_file} ]]; then
|
||||
zrecompile -pq ${zmodule_file}
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
# zcompile all prompt setup scripts
|
||||
for file in ${ZIM_HOME}/modules/prompt/functions/prompt_*_setup; do
|
||||
zrecompile -pq ${file}
|
||||
|
@ -42,4 +53,4 @@
|
|||
# zsh-histery-substring-search
|
||||
zrecompile -pq ${ZIM_HOME}/modules/history-substring-search/external/zsh-history-substring-search.zsh
|
||||
|
||||
) &!
|
||||
) &!
|
Loading…
Reference in a new issue