715f4a4e9c
for the autoloaded functions. According to the `zshbuiltins` documentation: Files containing multiple compiled functions are called `digest' files, and are intended to be used as elements of the FPATH/fpath special array. Also compiling all module init files, instead of some selected ones. This didn't impact performance much (time to run async block in zlogin when from 0.22s to 0.25s on my machine). Didn't manage to make adding the prompt `prompt_*_setup` functions to the digest file work, so kept these separate. Closes #86
45 lines
1.2 KiB
Bash
45 lines
1.2 KiB
Bash
|
|
|
|
#
|
|
# startup file read in interactive login shells
|
|
#
|
|
# The following code helps us by optimizing the existing framework.
|
|
# This includes zcompile, zcompdump, etc.
|
|
#
|
|
|
|
(
|
|
local zim_mods=${ZIM_HOME}/modules
|
|
setopt EXTENDED_GLOB
|
|
autoload -U zrecompile
|
|
|
|
# zcompile the completion cache; siginificant speedup.
|
|
for file in ${ZDOTDIR:-${HOME}}/.zcomp^(*.zwc)(.); do
|
|
zrecompile -pq ${file}
|
|
done
|
|
|
|
# zcompile .zshrc
|
|
zrecompile -pq ${ZDOTDIR:-${HOME}}/.zshrc
|
|
|
|
# zcompile all module init scripts
|
|
for file in ${zim_mods}/*/init.zsh; do
|
|
zrecompile -pq ${file}
|
|
done
|
|
|
|
# zcompile all autoloaded functions
|
|
zrecompile -pq ${ZIM_HOME}/functions ${zim_mods}/*/functions/^([_.]*|prompt_*_setup|README*|*.zwc)(.)
|
|
|
|
# zcompile all prompt setup scripts
|
|
for file in ${zim_mods}/prompt/functions/prompt_*_setup; do
|
|
zrecompile -pq ${file}
|
|
done
|
|
|
|
# syntax-highlighting
|
|
for file in ${zim_mods}/syntax-highlighting/external/highlighters/**^test-data/*.zsh; do
|
|
zrecompile -pq ${file}
|
|
done
|
|
zrecompile -pq ${zim_mods}/syntax-highlighting/external/zsh-syntax-highlighting.zsh
|
|
|
|
# zsh-histery-substring-search
|
|
zrecompile -pq ${zim_mods}/history-substring-search/external/zsh-history-substring-search.zsh
|
|
|
|
) &!
|