From 191fba04bbfe622cb4f1671f9cc3372cb3becc07 Mon Sep 17 00:00:00 2001 From: Dmytro Meleshko Date: Tue, 27 Apr 2021 14:48:16 +0300 Subject: [PATCH] [zsh] move zcompdump into ~/.cache --- zsh/plugins.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zsh/plugins.zsh b/zsh/plugins.zsh index df70f1d..e91bc94 100644 --- a/zsh/plugins.zsh +++ b/zsh/plugins.zsh @@ -1,6 +1,6 @@ #!/usr/bin/env zsh -ZSH_CACHE_DIR="$HOME/.cache/dotfiles" +ZSH_CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/dotfiles" if [[ ! -d "$ZSH_CACHE_DIR" ]]; then mkdir -pv "$ZSH_CACHE_DIR" fi @@ -28,7 +28,7 @@ _plugin completions 'zsh-users/zsh-completions' "$_checkout_latest_version" # . match only plain files # m-1 check if the file was modified today # see "Filename Generation" in zshexpn(1) - for match in $HOME/.zcompdump(N.m-1); do + for match in "${ZSH_CACHE_DIR}/zcompdump"(N.m-1); do run_compdump=0 break done; unset match @@ -36,7 +36,7 @@ _plugin completions 'zsh-users/zsh-completions' "$_checkout_latest_version" if (( $run_compdump )); then print -r -- "$0: rebuilding zsh completion dump" # -D flag turns off compdump loading - compinit -D + compinit -D -d "${ZSH_CACHE_DIR}/zcompdump" compdump else # -C flag disables some checks performed by compinit - they are not needed