zsh:autoload: Include all subdirs in autoload/
Make it possible to organize autoloadable functions.
This commit is contained in:
@@ -7,6 +7,12 @@ autoload -Uz run-help run-help-git zmv
|
||||
|
||||
# Load autoloadable functions
|
||||
if [[ -d "$ZDOTDIR/autoload" ]]; then
|
||||
# Include all subdirectories
|
||||
for d in "$ZDOTDIR/autoload/"*(/N); do
|
||||
fpath=("$d" $fpath)
|
||||
autoload -Uz -- "" "$d"/[^_.]*(.xN:t)
|
||||
done
|
||||
|
||||
fpath=("$ZDOTDIR/autoload" $fpath)
|
||||
autoload -Uz -- "" "${fpath[1]}"/[^_.]*(.xN:t)
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user