From 7bcf9dc74e1b3362b5020b27a0aad11a0fcfdd5a Mon Sep 17 00:00:00 2001 From: Sebastian Tramp Date: Mon, 7 Feb 2011 19:50:26 +0100 Subject: [PATCH] mod: rearrangement for autoload functions.d --- completion.zsh | 8 ++++++++ zshrc | 1 + 2 files changed, 9 insertions(+) diff --git a/completion.zsh b/completion.zsh index e25805b..3aa44a6 100644 --- a/completion.zsh +++ b/completion.zsh @@ -4,6 +4,14 @@ # tab completion configuration # +# add an autoload function path, if directory exists +# http://www.zsh.org/mla/users/2002/msg00232.html +functionsd="$HOME/.zsh/functions.d" +if [[ -d "$functionsd" ]] { + fpath=( $functionsd $fpath ) + autoload -U $functionsd/*(:t) +} + # load completions system zmodload -i zsh/complist diff --git a/zshrc b/zshrc index 2cba05b..e08cf4e 100644 --- a/zshrc +++ b/zshrc @@ -31,6 +31,7 @@ sources+="$HOME/.zsh/$systemFile.zsh" # Finally include the private.zsh file sources+="$HOME/.zsh/private.zsh" +# try to include all sources foreach file (`echo $sources`) if [[ -a $file ]]; then source $file