1
0
Fork 0
mirror of synced 2024-11-26 17:25:35 -05:00

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:
Eric Nielsen 2018-04-05 08:05:06 -05:00
parent 2ea2ba2fc8
commit fd822d28bb
2 changed files with 5 additions and 10 deletions

View file

@ -36,10 +36,8 @@ fi
if [[ ! -d ${zmodule_dir} ]]; then if [[ ! -d ${zmodule_dir} ]]; then
print "No such module \"${zmodule}\"." >&2 print "No such module \"${zmodule}\"." >&2
else else
for zmodule_file (${zmodule_dir}/{,zsh-}${zmodule}.zsh-theme \ for zmodule_file (${zmodule_dir}/init.zsh \
${zmodule_dir}/init.zsh \ ${zmodule_dir}/{,zsh-}${zmodule}.{zsh,plugin.zsh,zsh-theme,sh}); do
${zmodule_dir}/{,zsh-}${zmodule}.plugin.zsh \
${zmodule_dir}/{,zsh-}${zmodule}.{z,}sh); do
if [[ -f ${zmodule_file} ]]; then if [[ -f ${zmodule_file} ]]; then
source ${zmodule_file} source ${zmodule_file}
break break

View file

@ -8,7 +8,7 @@
# #
( (
local dir file local dir file zmodule zmodule_dir
setopt LOCAL_OPTIONS EXTENDED_GLOB setopt LOCAL_OPTIONS EXTENDED_GLOB
autoload -U zrecompile autoload -U zrecompile
@ -24,14 +24,11 @@
done done
# zcompile enabled module init scripts # zcompile enabled module init scripts
local zmodule zmodule_dir
for zmodule (${zmodules}); do for zmodule (${zmodules}); do
zmodule_dir=${ZIM_HOME}/modules/${zmodule} zmodule_dir=${ZIM_HOME}/modules/${zmodule}
if [[ -d ${zmodule_dir} ]]; then if [[ -d ${zmodule_dir} ]]; then
for file (${zmodule_dir}/{,zsh-}${zmodule}.zsh-theme \ for file (${zmodule_dir}/init.zsh \
${zmodule_dir}/init.zsh \ ${zmodule_dir}/{,zsh-}${zmodule}.{zsh,plugin.zsh,zsh-theme,sh}); do
${zmodule_dir}/{,zsh-}${zmodule}.plugin.zsh \
${zmodule_dir}/{,zsh-}${zmodule}.{z,}sh); do
if [[ -f ${file} ]]; then if [[ -f ${file} ]]; then
zrecompile -pq ${file} zrecompile -pq ${file}
break break