summaryrefslogtreecommitdiff
path: root/oh-my-zsh.sh
diff options
context:
space:
mode:
authorPat Regan <thehead@patshead.com>2011-04-12 17:41:09 -0400
committerPat Regan <thehead@patshead.com>2011-04-12 17:41:09 -0400
commit6bf906a2622ddea1e9aae5d23c544d37fc4b6a76 (patch)
tree4872a1101b2acbc0699febc48eb8806f7f8ac34f /oh-my-zsh.sh
parent16ac094a43052fb57eda9503174006a84a61a414 (diff)
downloadzsh-6bf906a2622ddea1e9aae5d23c544d37fc4b6a76.tar.gz
zsh-6bf906a2622ddea1e9aae5d23c544d37fc4b6a76.tar.bz2
zsh-6bf906a2622ddea1e9aae5d23c544d37fc4b6a76.zip
Optimize plugin loading so that only one call to compinit is required
Diffstat (limited to 'oh-my-zsh.sh')
-rw-r--r--oh-my-zsh.sh13
1 files changed, 11 insertions, 2 deletions
diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
index 84a850ca3..0c85de714 100644
--- a/oh-my-zsh.sh
+++ b/oh-my-zsh.sh
@@ -10,14 +10,23 @@ for config_file ($ZSH/lib/*.zsh) source $config_file
# Load all of your custom configurations from custom/
for config_file ($ZSH/custom/*.zsh) source $config_file
-# Load all of the plugins that were defined in ~/.zshrc
+# Add all defined plugins to fpath
plugin=${plugin:=()}
-for plugin ($plugins) source $ZSH/plugins/$plugin/$plugin.plugin.zsh
+for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath)
# Load and run compinit
autoload -U compinit
compinit -i
+# Load all of the plugins that were defined in ~/.zshrc
+for plugin ($plugins)
+do
+ if [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]
+ then
+ source $ZSH/plugins/$plugin/$plugin.plugin.zsh
+ fi
+done
+
# Load the theme
source "$ZSH/themes/$ZSH_THEME.zsh-theme"