Change order or module loading system
First choice is `init.zsh`, the script we use, introduced by Prezto. Next choices are based on which are the most common init scripts in the zsh-users repositories: * `zsh-autosuggestions`, `zsh-history-substring-search` and `zsh-syntax-highlighting` have `${zmodule}.zsh` * `zsh-completions` has `${zmodule}.plugin.zsh` Latter format apparently was introduced by Oh-My-Zsh. Leaving `${zmodule}.zsh-theme` and `${zmodule}.sh` as the last options.
This commit is contained in:
parent
2ea2ba2fc8
commit
fd822d28bb
2 changed files with 5 additions and 10 deletions
6
init.zsh
6
init.zsh
|
@ -36,10 +36,8 @@ fi
|
|||
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
|
||||
for zmodule_file (${zmodule_dir}/init.zsh \
|
||||
${zmodule_dir}/{,zsh-}${zmodule}.{zsh,plugin.zsh,zsh-theme,sh}); do
|
||||
if [[ -f ${zmodule_file} ]]; then
|
||||
source ${zmodule_file}
|
||||
break
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#
|
||||
|
||||
(
|
||||
local dir file
|
||||
local dir file zmodule zmodule_dir
|
||||
setopt LOCAL_OPTIONS EXTENDED_GLOB
|
||||
autoload -U zrecompile
|
||||
|
||||
|
@ -24,14 +24,11 @@
|
|||
done
|
||||
|
||||
# zcompile enabled module init scripts
|
||||
local zmodule zmodule_dir
|
||||
for zmodule (${zmodules}); do
|
||||
zmodule_dir=${ZIM_HOME}/modules/${zmodule}
|
||||
if [[ -d ${zmodule_dir} ]]; then
|
||||
for file (${zmodule_dir}/{,zsh-}${zmodule}.zsh-theme \
|
||||
${zmodule_dir}/init.zsh \
|
||||
${zmodule_dir}/{,zsh-}${zmodule}.plugin.zsh \
|
||||
${zmodule_dir}/{,zsh-}${zmodule}.{z,}sh); do
|
||||
for file (${zmodule_dir}/init.zsh \
|
||||
${zmodule_dir}/{,zsh-}${zmodule}.{zsh,plugin.zsh,zsh-theme,sh}); do
|
||||
if [[ -f ${file} ]]; then
|
||||
zrecompile -pq ${file}
|
||||
break
|
||||
|
|
Loading…
Reference in a new issue