X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fzshrc;h=7e6898a9565ee20a1a4f244959a134f7eac3e463;hb=df5ece4ab36a2d900a8b1d48b6ce60dd4172c224;hp=ab43aef67b063697f5e93cbbcddc314909f051f8;hpb=76fb54b0a068f79a6afa90e2b2add8df3611e505;p=grml-etc-core.git diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index ab43aef..7e6898a 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 @@ -1580,8 +1587,6 @@ function command_not_found_handler() { # history -ZSHDIR=${ZDOTDIR:-${HOME}/.zsh} - #v# HISTFILE=${ZDOTDIR:-${HOME}}/.zsh_history isgrmlcd && HISTSIZE=500 || HISTSIZE=5000 @@ -1625,7 +1630,7 @@ if [[ -f ${DIRSTACKFILE} ]]; then [[ -d $dirstack[1] ]] && cd -q $dirstack[1] && cd -q $OLDPWD fi -if zstyle -T ':grml:chpwd:dirstack' filter-on-load; then +if zstyle -t ':grml:chpwd:dirstack' filter-on-load; then for i in "${dirstack[@]}"; do if ! grml_dirstack_filter "$i"; then GRML_PERSISTENT_DIRSTACK=( @@ -2504,16 +2509,14 @@ hash -d www=/var/www if check_com -c screen ; then if [[ $UID -eq 0 ]] ; then if [[ -r /etc/grml/screenrc ]]; then - alias screen="${commands[screen]} -c /etc/grml/screenrc" + alias screen='screen -c /etc/grml/screenrc' fi - elif [[ -r $HOME/.screenrc ]] ; then - alias screen="${commands[screen]} -c $HOME/.screenrc" - else + elif [[ ! -r $HOME/.screenrc ]] ; then if [[ -r /etc/grml/screenrc_grml ]]; then - alias screen="${commands[screen]} -c /etc/grml/screenrc_grml" + alias screen='screen -c /etc/grml/screenrc_grml' else if [[ -r /etc/grml/screenrc ]]; then - alias screen="${commands[screen]} -c /etc/grml/screenrc" + alias screen='screen -c /etc/grml/screenrc' fi fi fi