From bf10ce72c540183751f0452b93050951f1fa3b40 Mon Sep 17 00:00:00 2001 From: Matt Hamilton Date: Mon, 4 Jan 2016 18:11:30 -0500 Subject: [PATCH] cleanup zlogin --- templates/zlogin | 61 +++++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 35 deletions(-) diff --git a/templates/zlogin b/templates/zlogin index 9595f4c..cd17dcc 100644 --- a/templates/zlogin +++ b/templates/zlogin @@ -15,44 +15,35 @@ fi } - # First, we will zcompile the completion cache, if it exists. Siginificant speedup. - zcompare ${ZDOTDIR:-${HOME}}/.zcompdump - - # Next, zcompile .zshrc if needed - zcompare ${ZDOTDIR:-${HOME}}/.zshrc - - # Now, zcompile some light module init scripts - zcompare ${ZDOTDIR:-${HOME}}/.zim/modules/git/init.zsh - zcompare ${ZDOTDIR:-${HOME}}/.zim/modules/utility/init.zsh - zcompare ${ZDOTDIR:-${HOME}}/.zim/modules/pacman/init.zsh - zcompare ${ZDOTDIR:-${HOME}}/.zim/modules/spectrum/init.zsh - zcompare ${ZDOTDIR:-${HOME}}/.zim/modules/completion/init.zsh - zcompare ${ZDOTDIR:-${HOME}}/.zim/modules/custom/init.zsh - - # Then, we should zcompile the 'heavy' modules where possible. - # This includes syntax-highlighting and completion. - # Other modules may be added to this list at a later date. - zim=${ZDOTDIR:-${HOME}}/.zim + zim_mods=${ZDOTDIR:-${HOME}}/.zim/modules setopt EXTENDED_GLOB - # - # syntax-highlighting zcompile - # - if [[ -d ${zim}/modules/syntax-highlighting/external/highlighters ]]; then - # compile the highlighters - for file in ${zim}/modules/syntax-highlighting/external/highlighters/**/*.zsh; do - zcompare ${file} - done - # compile the main file - zcompare ${zim}/modules/syntax-highlighting/external/zsh-syntax-highlighting.zsh - fi + # zcompile the completion cache; siginificant speedup. + zcompare ${ZDOTDIR:-${HOME}}/.zcompdump - # - # zsh-histery-substring-search zcompile - # - if [[ -s ${zim}/modules/history-substring-search/external/zsh-history-substring-search.zsh ]]; then - zcompare ${zim}/modules/history-substring-search/external/zsh-history-substring-search.zsh - fi + # zcompile .zshrc + zcompare ${ZDOTDIR:-${HOME}}/.zshrc + + # zcompile some light module init scripts + zcompare ${zim_mods}/git/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 + + # zcompile all .zsh files in the custom module + for file in ${zim_mods}/custom/**/*.zsh; do + zcompare ${file} + done + + # syntax-highlighting + for file in ${zim_mods}/syntax-highlighting/external/highlighters/**/*.zsh; do + 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 ) &!