From c6cb43fc21257e290abea3afde5af8007b59a9cc Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Mon, 6 Jan 2020 22:35:33 -0700 Subject: [PATCH] develop#zsh: check of ~/.zcompdump exists --- profiles/develop/zsh/zshrc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/profiles/develop/zsh/zshrc b/profiles/develop/zsh/zshrc index 5226c66c..5c09ceba 100644 --- a/profiles/develop/zsh/zshrc +++ b/profiles/develop/zsh/zshrc @@ -28,12 +28,16 @@ bindkey -M vicmd 'j' history-substring-search-down #load compinit autoload -Uz compinit -typeset -i updated_at=$(date +'%j' -r ~/.zcompdump \ - || stat -f '%Sm' -t '%j' ~/.zcompdump) +if [[ -f ~/.zcompdump ]]; then + typeset -i updated_at=$(date +'%j' -r ~/.zcompdump \ + || stat -f '%Sm' -t '%j' ~/.zcompdump) -# save time if completion cache has been update recently -if [ $(date +'%j') != $updated_at ]; then - compinit -u + # save time if completion cache has been update recently + if [ $(date +'%j') != $updated_at ]; then + compinit -u + else + compinit -C + fi else compinit -C fi