1
0
Fork 0
mirror of synced 2024-11-26 09:15:34 -05:00

Updated Plugin Loading

This commit is contained in:
AtomicCoding 2018-04-04 21:40:32 -07:00
parent 56b61e211d
commit 6c0f899c16
No known key found for this signature in database
GPG key ID: D9C2E2ED3C4516FA
2 changed files with 28 additions and 9 deletions

View file

@ -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
}
}

View file

@ -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
) &!
) &!