From: Frank Terbeck Date: Tue, 17 Feb 2009 11:51:05 +0000 (+0100) Subject: zshrc: Make /etc/zsh/functions.d recursive X-Git-Tag: v0.3.63~2 X-Git-Url: http://git.grml.org/?p=grml-etc-core.git;a=commitdiff_plain;h=b93d674c5bc4e4327f1ab2ddd3674056d0e8f7f5 zshrc: Make /etc/zsh/functions.d recursive That way, we can drop whole subsystems into there, if we want to, like: /etc/zsh/functions.d/VCS_Info/... This change also makes the code more backwards compatible. zrcautoload does not need the -U switch. It does that automatically depending on which zsh version is running. --- diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 9f3d87a..51141a1 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -526,10 +526,12 @@ if [[ -n "$BROKEN_COMPLETION_DIR" ]] ; then else [[ -d /etc/zsh/completion.d ]] && fpath=( $fpath /etc/zsh/completion.d ) if [[ -d /etc/zsh/functions.d ]] ; then - fpath+=( /etc/zsh/functions.d ) - for func in /etc/zsh/functions.d/[^_]*[^~](N.) ; do - zrcautoload -U ${func:t} + fdir='/etc/zsh/functions.d' + fpath=( ${fdir} ${fdir}/**/*(/N) ${fpath} ) + for func in ${fdir}/**/[^_]*[^~](N.) ; do + zrcautoload ${func:t} done + unset fdir fi fi