From 6b8046d0af1b48464f3b8d5ea169d0eb5fb576bc Mon Sep 17 00:00:00 2001 From: Simon Gomizelj Date: Tue, 29 Nov 2011 13:37:34 -0500 Subject: [PATCH] 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. --- oh-my-zsh.zsh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/oh-my-zsh.zsh b/oh-my-zsh.zsh index 09ea98919..9e7e87452 100644 --- a/oh-my-zsh.zsh +++ b/oh-my-zsh.zsh @@ -2,6 +2,7 @@ ZSH=${ZSH:-/usr/share/oh-my-zsh/} local config_file plugin +plugin=${plugin:=()} # add a function path fpath=($ZSH/functions $ZSH/completions $fpath) @@ -11,18 +12,21 @@ if [[ -d ~/.omz ]]; then [[ -d ~/.omz/completion ]] && fpath=(~/.omz/completions $fpath) 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/lib ]]; then - for config_file (~/.omz/lib/*.zsh) source $config_file - fi + for config_file (~/.omz/*.zsh(N)) + source $config_file fi -plugin=${plugin:=()} -for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath) +for plugin ($plugins) + fpath=($ZSH/plugins/$plugin $fpath) + if [[ -d ~/.omz ]]; then if [[ -d ~/.omz/plugins ]]; then - for plugin ($plugins) fpath=(~/.omz/plugins/$plugin $fpath) + for plugin ($plugins) + fpath=(~/.omz/plugins/$plugin $fpath) fi fi