Source .zsh files ~/.omz instead of ~/.omz/lib for user customizations. Use NULL_GLOB when sourcing files in directory to properly deal with no matches.

This commit is contained in:
Simon Gomizelj 2011-11-29 13:37:34 -05:00
commit 6b8046d0af

View file

@ -2,6 +2,7 @@
ZSH=${ZSH:-/usr/share/oh-my-zsh/} ZSH=${ZSH:-/usr/share/oh-my-zsh/}
local config_file plugin local config_file plugin
plugin=${plugin:=()}
# add a function path # add a function path
fpath=($ZSH/functions $ZSH/completions $fpath) fpath=($ZSH/functions $ZSH/completions $fpath)
@ -11,18 +12,21 @@ if [[ -d ~/.omz ]]; then
[[ -d ~/.omz/completion ]] && fpath=(~/.omz/completions $fpath) [[ -d ~/.omz/completion ]] && fpath=(~/.omz/completions $fpath)
fi fi
for config_file ($ZSH/lib/*.zsh) source $config_file for config_file ($ZSH/lib/*.zsh(N))
source $config_file
if [[ -d ~/.omz ]]; then if [[ -d ~/.omz ]]; then
if [[ -d ~/.omz/lib ]]; then for config_file (~/.omz/*.zsh(N))
for config_file (~/.omz/lib/*.zsh) source $config_file source $config_file
fi
fi fi
plugin=${plugin:=()} for plugin ($plugins)
for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath) fpath=($ZSH/plugins/$plugin $fpath)
if [[ -d ~/.omz ]]; then if [[ -d ~/.omz ]]; then
if [[ -d ~/.omz/plugins ]]; then if [[ -d ~/.omz/plugins ]]; then
for plugin ($plugins) fpath=(~/.omz/plugins/$plugin $fpath) for plugin ($plugins)
fpath=(~/.omz/plugins/$plugin $fpath)
fi fi
fi fi