From fd822d28bb5c952984deb99e34f2519ddb2a8703 Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Thu, 5 Apr 2018 08:05:06 -0500 Subject: [PATCH] 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. --- init.zsh | 6 ++---- login_init.zsh | 9 +++------ 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/init.zsh b/init.zsh index 6871aad..7f5c6b6 100755 --- a/init.zsh +++ b/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 diff --git a/login_init.zsh b/login_init.zsh index bc856dc..0be8a94 100755 --- a/login_init.zsh +++ b/login_init.zsh @@ -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