feat: build completions only once a day; improve startup time

This commit is contained in:
Daniel Bauer
2026-08-22 11:57:01 +02:00
parent 78b0463b51
commit 2bac4dd8c4

View File

@@ -12,7 +12,18 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
autoload -U +X compinit && compinit # fix compdef not found
# Load compdef immediately (needed before antidote loads plugins that call
# it), but only do the expensive security audit + dump rebuild once a day;
# otherwise just source the existing dump (-C).
autoload -U +X compinit
() {
setopt local_options extended_glob
if [[ -n ${HOME}/.zcompdump(#qN.mh+24) ]]; then
compinit
else
compinit -C 2>/dev/null || compinit
fi
}
if [ -f $HOME/.zshrc_local ]; then
source $HOME/.zshrc_local