|
@@ -8,52 +8,37 @@
|
|
|
#
|
|
|
|
|
|
(
|
|
|
- # Function to determine the need of a zcompile. If the .zwc file
|
|
|
- # does not exist, or the base file is newer, we need to compile.
|
|
|
- # These jobs are asynchronous, and will not impact the interactive shell
|
|
|
- zcompare() {
|
|
|
- if [[ -s ${1} && ( ! -s ${1}.zwc || ${1} -nt ${1}.zwc ) ]]; then
|
|
|
- zcompile ${1}
|
|
|
- fi
|
|
|
- }
|
|
|
-
|
|
|
- local zim_mods=${ZIM_HOME}/modules
|
|
|
- setopt EXTENDED_GLOB
|
|
|
-
|
|
|
- # zcompile the completion cache; siginificant speedup.
|
|
|
- for file in ${ZDOTDIR:-${HOME}}/.zcomp^(*.zwc)(.); do
|
|
|
- zcompare ${file}
|
|
|
- done
|
|
|
+ local file
|
|
|
+ local zmodule
|
|
|
+ setopt LOCAL_OPTIONS EXTENDED_GLOB
|
|
|
+ autoload -U zrecompile
|
|
|
+
|
|
|
+ # zcompile the completion cache; siginificant speedup
|
|
|
+ zrecompile -pq ${ZDOTDIR:-${HOME}}/${zcompdump_file:-.zcompdump}
|
|
|
|
|
|
# zcompile .zshrc
|
|
|
- zcompare ${ZDOTDIR:-${HOME}}/.zshrc
|
|
|
-
|
|
|
- # zcompile some light module init scripts
|
|
|
- zcompare ${zim_mods}/git/init.zsh
|
|
|
- zcompare ${zim_mods}/git-info/init.zsh
|
|
|
- zcompare ${zim_mods}/utility/init.zsh
|
|
|
- zcompare ${zim_mods}/pacman/init.zsh
|
|
|
- zcompare ${zim_mods}/spectrum/init.zsh
|
|
|
- zcompare ${zim_mods}/completion/init.zsh
|
|
|
- zcompare ${zim_mods}/fasd/init.zsh
|
|
|
-
|
|
|
- # zcompile all .zsh files in the custom module
|
|
|
- for file in ${zim_mods}/custom/**/^(README.md|*.zwc)(.); do
|
|
|
- zcompare ${file}
|
|
|
+ zrecompile -pq ${ZDOTDIR:-${HOME}}/.zshrc
|
|
|
+
|
|
|
+ # zcompile enabled module autoloaded functions
|
|
|
+ zrecompile -pq ${ZIM_HOME}/functions ${ZIM_HOME}/modules/${^zmodules}/functions/^([_.]*|prompt_*_setup|README*|*.zwc)(-.N)
|
|
|
+
|
|
|
+ # zcompile enabled module init scripts
|
|
|
+ for zmodule (${zmodules}); do
|
|
|
+ zrecompile -pq ${ZIM_HOME}/modules/${zmodule}/init.zsh
|
|
|
done
|
|
|
|
|
|
- # zcompile all autoloaded functions
|
|
|
- for file in ${zim_mods}/**/functions/^(*.zwc)(.); do
|
|
|
- zcompare ${file}
|
|
|
+ # zcompile all prompt setup scripts
|
|
|
+ for file in ${ZIM_HOME}/modules/prompt/functions/prompt_*_setup; do
|
|
|
+ zrecompile -pq ${file}
|
|
|
done
|
|
|
|
|
|
# syntax-highlighting
|
|
|
- for file in ${zim_mods}/syntax-highlighting/external/highlighters/**^test-data/*.zsh; do
|
|
|
- zcompare ${file}
|
|
|
+ for file in ${ZIM_HOME}/modules/syntax-highlighting/external/highlighters/**^test-data/*.zsh; do
|
|
|
+ zrecompile -pq ${file}
|
|
|
done
|
|
|
- zcompare ${zim_mods}/syntax-highlighting/external/zsh-syntax-highlighting.zsh
|
|
|
+ zrecompile -pq ${ZIM_HOME}/modules/syntax-highlighting/external/zsh-syntax-highlighting.zsh
|
|
|
|
|
|
# zsh-histery-substring-search
|
|
|
- zcompare ${zim_mods}/history-substring-search/external/zsh-history-substring-search.zsh
|
|
|
+ zrecompile -pq ${ZIM_HOME}/modules/history-substring-search/external/zsh-history-substring-search.zsh
|
|
|
|
|
|
) &!
|