X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fzshrc;h=018914c7746fbbb53d47254231d4d37018f9255e;hb=8ac2e84c61fe067dc2676cbf4b29d431c209bcf8;hp=79294d216a9b4595f0986226d1c21c83ed92ce27;hpb=d0efc44af1d049776967ae980611631be13d7561;p=grml-etc-core.git diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 79294d2..018914c 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -88,8 +88,16 @@ # Search path for the cd comman # cdpath=(.. ~) -# Support our own site-functions - [ -d /etc/zsh/site-functions ] && FPATH=/etc/zsh/site-functions:$FPATH +# completion functions go to /etc/zsh/completion.d +# function files may be put into /etc/zsh/functions.d, from where they +# will be automatically autoloaded. + [[ -d /etc/zsh/completion.d ]] && fpath+=( /etc/zsh/completion.d ) + if [[ -d /etc/zsh/functions.d ]] ; then + fpath+=( /etc/zsh/functions.d ) + for func in /etc/zsh/functions.d/[^_]*[^~] ; do + autoload -U ${func:t} + done + fi # automatically remove duplicates from these arrays typeset -U path cdpath fpath manpath @@ -764,12 +772,6 @@ Run "grml-tips ssl-certificate" if you need further instructions. # {{{ completion stuff -# Where to look for autoloaded function definitions - if [ -d /etc/zsh/completion.d ] ; then - local comp=/etc/zsh/completion.d - for func in $comp/*(N-.:t); . ${comp}/${func} - fi - # called later (via is4 && grmlcomp) # notice: use 'zstyle' for getting current settings # press ^Xh (control-x h) for getting tags in context; ^X? (control-x ?) to run complete_debug with trace output