X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fzshrc;h=80828e04f16ef645b02ce1901826eafae14e2c66;hb=fd3a55f78b1e316727760a92dcd3f0759013549c;hp=a6f967037bad0b69f8c0028d16aab62a93ea56b4;hpb=21c8c5cf7e67b38bf42cdc19af6629fd6346d8f0;p=grml-etc-core.git diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index a6f9670..80828e0 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -805,9 +805,16 @@ grmlcomp() { # command for process lists, the local web server details and host completion zstyle ':completion:*:urls' local 'www' '/var/www/' 'public_html' - # caching - [[ -d $ZSHDIR/cache ]] && zstyle ':completion:*' use-cache yes && \ - zstyle ':completion::complete:*' cache-path $ZSHDIR/cache/ + # Some functions, like _apt and _dpkg, are very slow. We can use a cache in + # order to speed things up + if [[ ${GRML_COMP_CACHING:-yes} == yes ]]; then + GRML_COMP_CACHE_DIR=${GRML_COMP_CACHE_DIR:-${ZDOTDIR:-$HOME}/.cache} + if [[ ! -d ${GRML_COMP_CACHE_DIR} ]]; then + command mkdir -p "${GRML_COMP_CACHE_DIR}" + fi + zstyle ':completion:*' use-cache yes + zstyle ':completion:*:complete:*' cache-path "${GRML_COMP_CACHE_DIR}" + fi # host completion if is42 ; then