From b93d674c5bc4e4327f1ab2ddd3674056d0e8f7f5 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Tue, 17 Feb 2009 12:51:05 +0100 Subject: [PATCH] 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. --- etc/zsh/zshrc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 -- 2.1.4