2015-12-15 00:12:17 -05:00
|
|
|
#
|
2015-12-31 11:05:09 -05:00
|
|
|
# startup file read in interactive login shells
|
2015-12-15 00:12:17 -05:00
|
|
|
#
|
|
|
|
# The following code helps us by optimizing the existing framework.
|
2015-12-28 02:09:44 -05:00
|
|
|
# This includes zcompile, zcompdump, etc.
|
2015-12-15 00:12:17 -05:00
|
|
|
#
|
|
|
|
|
2018-07-07 16:46:30 -04:00
|
|
|
zcompare() {
|
|
|
|
if [[ -s ${1} && ( ! -s ${1}.zwc || ${1} -nt ${1}.zwc) ]]; then
|
|
|
|
zcompile ${1}
|
|
|
|
fi
|
|
|
|
}
|
2017-09-26 13:28:08 -04:00
|
|
|
|
2018-07-07 16:46:30 -04:00
|
|
|
(
|
|
|
|
local dir file
|
|
|
|
setopt LOCAL_OPTIONS EXTENDED_GLOB
|
|
|
|
autoload -U zrecompile
|
|
|
|
# zcompile the completion cache; siginificant speedup
|
|
|
|
zcompare ${ZDOTDIR:-${HOME}}/${zcompdump_file:-.zcompdump}
|
2015-12-15 00:12:17 -05:00
|
|
|
|
2018-07-07 16:46:30 -04:00
|
|
|
# zcompile .zshrc
|
|
|
|
zcompare ${ZDOTDIR:-${HOME}}/.zshrc
|
2017-09-26 13:28:08 -04:00
|
|
|
|
2018-07-07 16:46:30 -04:00
|
|
|
# zcompile enabled module autoloaded functions
|
|
|
|
for dir in ${ZIM_HOME}/modules/${^zmodules}/functions(/FN); do
|
2018-04-09 19:12:34 -04:00
|
|
|
zrecompile -pq ${dir}.zwc ${dir}/^(_*|prompt_*_setup|*.*)(-.N)
|
2018-07-07 16:46:30 -04:00
|
|
|
done
|
2017-09-26 13:28:08 -04:00
|
|
|
|
2018-07-07 16:46:30 -04:00
|
|
|
# zcompile enabled module scripts
|
|
|
|
for file in ${ZIM_HOME}/modules/${^zmodules}/(^*test*/)#*.zsh{,-theme}(.NLk+1); do
|
|
|
|
zcompare ${file}
|
|
|
|
done
|
2016-01-04 18:11:30 -05:00
|
|
|
|
2018-07-07 16:46:30 -04:00
|
|
|
# zcompile all prompt setup scripts
|
|
|
|
for file in ${ZIM_HOME}/modules/prompt/functions/prompt_*_setup; do
|
|
|
|
zcompare ${file}
|
|
|
|
done
|
2015-12-28 02:09:44 -05:00
|
|
|
) &!
|