1
0
Fork 0
mirror of synced 2024-11-22 15:25:34 -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
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

View file

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