2016-05-14 17:28:15 -04:00
|
|
|
|
|
|
|
|
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
|
|
|
#
|
|
|
|
|
2015-12-28 02:09:44 -05:00
|
|
|
(
|
|
|
|
# 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() {
|
2017-09-26 09:23:30 -04:00
|
|
|
if [[ -s ${1} && ( ! -s ${1}.zwc || ${1} -nt ${1}.zwc ) ]]; then
|
2015-12-28 02:09:44 -05:00
|
|
|
zcompile ${1}
|
|
|
|
fi
|
|
|
|
}
|
2015-12-15 00:12:17 -05:00
|
|
|
|
2017-09-26 09:23:30 -04:00
|
|
|
local zim_mods=${ZIM_HOME}/modules
|
2016-01-04 18:11:30 -05:00
|
|
|
setopt EXTENDED_GLOB
|
|
|
|
|
|
|
|
# zcompile the completion cache; siginificant speedup.
|
2016-04-16 17:56:46 -04:00
|
|
|
for file in ${ZDOTDIR:-${HOME}}/.zcomp^(*.zwc)(.); do
|
|
|
|
zcompare ${file}
|
|
|
|
done
|
2015-12-15 00:12:17 -05:00
|
|
|
|
2016-01-04 18:11:30 -05:00
|
|
|
# zcompile .zshrc
|
2015-12-19 09:48:29 -05:00
|
|
|
zcompare ${ZDOTDIR:-${HOME}}/.zshrc
|
2015-12-16 02:23:18 -05:00
|
|
|
|
2016-01-04 18:11:30 -05:00
|
|
|
# zcompile some light module init scripts
|
|
|
|
zcompare ${zim_mods}/git/init.zsh
|
2017-09-26 09:23:30 -04:00
|
|
|
zcompare ${zim_mods}/git-info/init.zsh
|
2016-01-04 18:11:30 -05:00
|
|
|
zcompare ${zim_mods}/utility/init.zsh
|
|
|
|
zcompare ${zim_mods}/pacman/init.zsh
|
|
|
|
zcompare ${zim_mods}/spectrum/init.zsh
|
|
|
|
zcompare ${zim_mods}/completion/init.zsh
|
2016-02-27 19:43:19 -05:00
|
|
|
zcompare ${zim_mods}/fasd/init.zsh
|
2016-01-04 18:11:30 -05:00
|
|
|
|
|
|
|
# zcompile all .zsh files in the custom module
|
2016-02-08 22:16:19 -05:00
|
|
|
for file in ${zim_mods}/custom/**/^(README.md|*.zwc)(.); do
|
2016-01-04 18:11:30 -05:00
|
|
|
zcompare ${file}
|
|
|
|
done
|
|
|
|
|
2016-02-27 19:43:19 -05:00
|
|
|
# zcompile all autoloaded functions
|
|
|
|
for file in ${zim_mods}/**/functions/^(*.zwc)(.); do
|
|
|
|
zcompare ${file}
|
|
|
|
done
|
|
|
|
|
2016-01-04 18:11:30 -05:00
|
|
|
# syntax-highlighting
|
2017-09-11 15:27:12 -04:00
|
|
|
for file in ${zim_mods}/syntax-highlighting/external/highlighters/**^test-data/*.zsh; do
|
2016-01-04 18:11:30 -05:00
|
|
|
zcompare ${file}
|
|
|
|
done
|
|
|
|
zcompare ${zim_mods}/syntax-highlighting/external/zsh-syntax-highlighting.zsh
|
|
|
|
|
|
|
|
# zsh-histery-substring-search
|
|
|
|
zcompare ${zim_mods}/history-substring-search/external/zsh-history-substring-search.zsh
|
2015-12-15 00:12:17 -05:00
|
|
|
|
2015-12-28 02:09:44 -05:00
|
|
|
) &!
|