From e7e0fb914a8025222048deca1dff37b43d0d620e Mon Sep 17 00:00:00 2001 From: Sam Jones Date: Fri, 14 Oct 2016 09:38:19 -0400 Subject: [PATCH] Speeds up completion startup Before this change, completion startup would rebuild ~/.zcompdump each time a new shell was created. After this change, completion startup will only rebuild ~/.zcompdump once per day. This dramatically speeds up the startup time for Prezto for all but the first startup of the day. --- modules/completion/init.zsh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/completion/init.zsh b/modules/completion/init.zsh index 023a90e7..7da53994 100644 --- a/modules/completion/init.zsh +++ b/modules/completion/init.zsh @@ -15,7 +15,15 @@ fi fpath=("${0:h}/external/src" $fpath) # Load and initialize the completion system ignoring insecure directories. -autoload -Uz compinit && compinit -i +# Will only rebuild ~/.zcompdump once per day +autoload -Uz compinit +if [ $(date +'%j') != $(stat -f '%Sm' -t '%j' ~/.zcompdump) ]; then + compinit +else + compinit -C +fi + + # # Options