From 782883b5d8db1971cc14948b9c2adc51f17f8898 Mon Sep 17 00:00:00 2001 From: Pat Regan Date: Fri, 8 Apr 2011 10:12:22 -0400 Subject: [PATCH 01/10] Replace redundant calls to compinit with a single call. --- lib/completion.zsh | 3 --- lib/key-bindings.zsh | 2 -- oh-my-zsh.sh | 4 ++++ plugins/brew/brew.plugin.zsh | 2 -- plugins/cpanm/cpanm.plugin.zsh | 2 -- plugins/gem/gem.plugin.zsh | 2 -- plugins/github/github.plugin.zsh | 2 -- plugins/macports/macports.plugin.zsh | 2 -- plugins/pip/pip.plugin.zsh | 2 -- plugins/vagrant/vagrant.plugin.zsh | 2 -- 10 files changed, 4 insertions(+), 19 deletions(-) diff --git a/lib/completion.zsh b/lib/completion.zsh index e8e9776..3c5a41e 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -9,9 +9,6 @@ setopt always_to_end WORDCHARS='' -autoload -U compinit -compinit -i - zmodload -i zsh/complist ## case-insensitive (all),partial-word and then substring completion diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh index 7196a88..c7ad907 100644 --- a/lib/key-bindings.zsh +++ b/lib/key-bindings.zsh @@ -1,6 +1,4 @@ # TODO: Explain what some of this does.. -autoload -U compinit -compinit -i bindkey -e bindkey '\ew' kill-region diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 291772d..805e924 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -17,6 +17,10 @@ for plugin ($plugins) source $ZSH/plugins/$plugin/$plugin.plugin.zsh # Load the theme source "$ZSH/themes/$ZSH_THEME.zsh-theme" +# Load and run compinit +autoload -U compinit +compinit -i + # Check for updates on initial load... if [ "$DISABLE_AUTO_UPDATE" = "true" ] then diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh index 353a189..079c0fb 100644 --- a/plugins/brew/brew.plugin.zsh +++ b/plugins/brew/brew.plugin.zsh @@ -1,4 +1,2 @@ # add brew completion function to path fpath=($ZSH/plugins/brew $fpath) -autoload -U compinit -compinit -i diff --git a/plugins/cpanm/cpanm.plugin.zsh b/plugins/cpanm/cpanm.plugin.zsh index af52d3e..8425b5a 100644 --- a/plugins/cpanm/cpanm.plugin.zsh +++ b/plugins/cpanm/cpanm.plugin.zsh @@ -1,4 +1,2 @@ # add cpanm completion function to path fpath=($ZSH/plugins/cpanm $fpath) -autoload -U compinit -compinit -i diff --git a/plugins/gem/gem.plugin.zsh b/plugins/gem/gem.plugin.zsh index d4e5c65..cdfad7a 100644 --- a/plugins/gem/gem.plugin.zsh +++ b/plugins/gem/gem.plugin.zsh @@ -1,4 +1,2 @@ # add gem completion function to path fpath=($ZSH/plugins/gem $fpath) -autoload -U compinit -compinit -i diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh index c23504b..0858783 100644 --- a/plugins/github/github.plugin.zsh +++ b/plugins/github/github.plugin.zsh @@ -1,4 +1,2 @@ # add github completion function to path fpath=($ZSH/plugins/github $fpath) -autoload -U compinit -compinit -i diff --git a/plugins/macports/macports.plugin.zsh b/plugins/macports/macports.plugin.zsh index cbbc492..492a665 100644 --- a/plugins/macports/macports.plugin.zsh +++ b/plugins/macports/macports.plugin.zsh @@ -8,5 +8,3 @@ alias pup="psu && puo" # add macports completion function to path fpath=($ZSH/plugins/macports $fpath) -autoload -U compinit -compinit -i diff --git a/plugins/pip/pip.plugin.zsh b/plugins/pip/pip.plugin.zsh index bf9f239..740f962 100644 --- a/plugins/pip/pip.plugin.zsh +++ b/plugins/pip/pip.plugin.zsh @@ -1,4 +1,2 @@ # add brew completion function to path fpath=($ZSH/plugins/pip $fpath) -autoload -U compinit -compinit -i diff --git a/plugins/vagrant/vagrant.plugin.zsh b/plugins/vagrant/vagrant.plugin.zsh index 5e9bcf1..98d2d70 100644 --- a/plugins/vagrant/vagrant.plugin.zsh +++ b/plugins/vagrant/vagrant.plugin.zsh @@ -1,3 +1 @@ fpath=($ZSH/plugins/vagrant $fpath) -autoload -U compinit -compinit -i From a56e12932f9dbb923b1d935b6741243f1040665a Mon Sep 17 00:00:00 2001 From: Pat Regan Date: Fri, 8 Apr 2011 11:10:14 -0400 Subject: [PATCH 02/10] Moved the single compinit call from oh-my-zsh.sh to lib/completion.zsh --- lib/completion.zsh | 4 ++++ oh-my-zsh.sh | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/completion.zsh b/lib/completion.zsh index 3c5a41e..21735e7 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -60,3 +60,7 @@ zstyle ':completion:*:*:*:users' ignored-patterns \ # ... unless we really want to. zstyle '*' single-ignored show +# Load and run compinit +autoload -U compinit +compinit -i + diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 805e924..3970a49 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -18,8 +18,8 @@ for plugin ($plugins) source $ZSH/plugins/$plugin/$plugin.plugin.zsh source "$ZSH/themes/$ZSH_THEME.zsh-theme" # Load and run compinit -autoload -U compinit -compinit -i +#autoload -U compinit +#compinit -i # Check for updates on initial load... if [ "$DISABLE_AUTO_UPDATE" = "true" ] From eeea6e4fb6999bc1e9e9f404162a31ec85cff20e Mon Sep 17 00:00:00 2001 From: Pat Regan Date: Fri, 8 Apr 2011 11:12:21 -0400 Subject: [PATCH 03/10] Removed commented out code. --- oh-my-zsh.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 3970a49..291772d 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -17,10 +17,6 @@ for plugin ($plugins) source $ZSH/plugins/$plugin/$plugin.plugin.zsh # Load the theme source "$ZSH/themes/$ZSH_THEME.zsh-theme" -# Load and run compinit -#autoload -U compinit -#compinit -i - # Check for updates on initial load... if [ "$DISABLE_AUTO_UPDATE" = "true" ] then From af0b6ac28f6a78d8d41b0b2c56ab1f470183116f Mon Sep 17 00:00:00 2001 From: Pat Regan Date: Tue, 12 Apr 2011 09:28:15 -0400 Subject: [PATCH 04/10] Moved compinit call back to oh-my-zsh.sh, after plugins are loaded --- lib/completion.zsh | 4 ---- oh-my-zsh.sh | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/completion.zsh b/lib/completion.zsh index 21735e7..3c5a41e 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -60,7 +60,3 @@ zstyle ':completion:*:*:*:users' ignored-patterns \ # ... unless we really want to. zstyle '*' single-ignored show -# Load and run compinit -autoload -U compinit -compinit -i - diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 291772d..84a850c 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -14,6 +14,10 @@ for config_file ($ZSH/custom/*.zsh) source $config_file plugin=${plugin:=()} for plugin ($plugins) source $ZSH/plugins/$plugin/$plugin.plugin.zsh +# Load and run compinit +autoload -U compinit +compinit -i + # Load the theme source "$ZSH/themes/$ZSH_THEME.zsh-theme" From 6aad987f8231960462eca900d2dc77ad10cfb9aa Mon Sep 17 00:00:00 2001 From: Pat Regan Date: Tue, 12 Apr 2011 17:41:09 -0400 Subject: [PATCH 05/10] Optimize plugin loading so that only one call to compinit is required --- oh-my-zsh.sh | 13 +++++++++++-- plugins/brew/brew.plugin.zsh | 2 -- plugins/cpanm/cpanm.plugin.zsh | 2 -- plugins/gem/gem.plugin.zsh | 2 -- plugins/github/github.plugin.zsh | 2 -- plugins/macports/macports.plugin.zsh | 2 -- plugins/pip/pip.plugin.zsh | 2 -- plugins/vagrant/vagrant.plugin.zsh | 1 - 8 files changed, 11 insertions(+), 15 deletions(-) delete mode 100644 plugins/brew/brew.plugin.zsh delete mode 100644 plugins/cpanm/cpanm.plugin.zsh delete mode 100644 plugins/gem/gem.plugin.zsh delete mode 100644 plugins/github/github.plugin.zsh delete mode 100644 plugins/pip/pip.plugin.zsh delete mode 100644 plugins/vagrant/vagrant.plugin.zsh diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 84a850c..0c85de7 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" diff --git a/plugins/brew/brew.plugin.zsh b/plugins/brew/brew.plugin.zsh deleted file mode 100644 index 079c0fb..0000000 --- a/plugins/brew/brew.plugin.zsh +++ /dev/null @@ -1,2 +0,0 @@ -# add brew completion function to path -fpath=($ZSH/plugins/brew $fpath) diff --git a/plugins/cpanm/cpanm.plugin.zsh b/plugins/cpanm/cpanm.plugin.zsh deleted file mode 100644 index 8425b5a..0000000 --- a/plugins/cpanm/cpanm.plugin.zsh +++ /dev/null @@ -1,2 +0,0 @@ -# add cpanm completion function to path -fpath=($ZSH/plugins/cpanm $fpath) diff --git a/plugins/gem/gem.plugin.zsh b/plugins/gem/gem.plugin.zsh deleted file mode 100644 index cdfad7a..0000000 --- a/plugins/gem/gem.plugin.zsh +++ /dev/null @@ -1,2 +0,0 @@ -# add gem completion function to path -fpath=($ZSH/plugins/gem $fpath) diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh deleted file mode 100644 index 0858783..0000000 --- a/plugins/github/github.plugin.zsh +++ /dev/null @@ -1,2 +0,0 @@ -# add github completion function to path -fpath=($ZSH/plugins/github $fpath) diff --git a/plugins/macports/macports.plugin.zsh b/plugins/macports/macports.plugin.zsh index 492a665..277352e 100644 --- a/plugins/macports/macports.plugin.zsh +++ b/plugins/macports/macports.plugin.zsh @@ -6,5 +6,3 @@ alias puni="sudo port uninstall inactive" alias puo="sudo port upgrade outdated" alias pup="psu && puo" -# add macports completion function to path -fpath=($ZSH/plugins/macports $fpath) diff --git a/plugins/pip/pip.plugin.zsh b/plugins/pip/pip.plugin.zsh deleted file mode 100644 index 740f962..0000000 --- a/plugins/pip/pip.plugin.zsh +++ /dev/null @@ -1,2 +0,0 @@ -# add brew completion function to path -fpath=($ZSH/plugins/pip $fpath) diff --git a/plugins/vagrant/vagrant.plugin.zsh b/plugins/vagrant/vagrant.plugin.zsh deleted file mode 100644 index 98d2d70..0000000 --- a/plugins/vagrant/vagrant.plugin.zsh +++ /dev/null @@ -1 +0,0 @@ -fpath=($ZSH/plugins/vagrant $fpath) From 87030f4d83eb9cfe8883bd9a109b48a0a9e8a70e Mon Sep 17 00:00:00 2001 From: Pat Regan Date: Tue, 12 Apr 2011 17:50:15 -0400 Subject: [PATCH 06/10] Moved the plugin fpath loop and compinit so they happen before custom scripts are loaded. --- oh-my-zsh.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 0c85de7..ad4b268 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -7,9 +7,6 @@ fpath=($ZSH/functions $fpath) # TIP: Add files you don't want in git to .gitignore 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 - # Add all defined plugins to fpath plugin=${plugin:=()} for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath) @@ -18,6 +15,9 @@ for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath) autoload -U compinit compinit -i +# 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 for plugin ($plugins) do From 42b7e5d0beef16eebf3a4331ed940329038455d7 Mon Sep 17 00:00:00 2001 From: Pat Regan Date: Tue, 12 Apr 2011 19:53:55 -0400 Subject: [PATCH 07/10] Minor reformatting --- oh-my-zsh.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index ad4b268..c7a4c32 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -19,10 +19,8 @@ compinit -i for config_file ($ZSH/custom/*.zsh) source $config_file # Load all of the plugins that were defined in ~/.zshrc -for plugin ($plugins) -do - if [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ] - then +for plugin ($plugins); do + if [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then source $ZSH/plugins/$plugin/$plugin.plugin.zsh fi done From 9899c2445c3cccce21c075d10ae86496bf33b7a4 Mon Sep 17 00:00:00 2001 From: Pat Regan Date: Wed, 20 Apr 2011 01:30:52 -0400 Subject: [PATCH 08/10] Remove fpath/compinit code from github and npm plugins --- plugins/github/github.plugin.zsh | 4 ---- plugins/npm/npm.plugin.zsh | 4 ---- 2 files changed, 8 deletions(-) delete mode 100644 plugins/npm/npm.plugin.zsh diff --git a/plugins/github/github.plugin.zsh b/plugins/github/github.plugin.zsh index 8d45806..df7053b 100644 --- a/plugins/github/github.plugin.zsh +++ b/plugins/github/github.plugin.zsh @@ -5,7 +5,3 @@ if [ "$commands[(I)hub]" ]; then function git(){hub "$@"} fi -# add github completion function to path -fpath=($ZSH/plugins/github $fpath) -autoload -U compinit -compinit -i diff --git a/plugins/npm/npm.plugin.zsh b/plugins/npm/npm.plugin.zsh deleted file mode 100644 index 826f0f7..0000000 --- a/plugins/npm/npm.plugin.zsh +++ /dev/null @@ -1,4 +0,0 @@ -# add npm completion function to path -fpath=($ZSH/plugins/npm $fpath) -autoload -U compinit -compinit -i From b003fc59a4c1f37699975641fc9944fd1ad43b04 Mon Sep 17 00:00:00 2001 From: Pat Regan Date: Wed, 27 Apr 2011 19:46:23 -0400 Subject: [PATCH 09/10] redis-cli.plugin.zsh removed, adding to the fpath isn't needed now --- plugins/redis-cli/redis-cli.plugin.zsh | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 plugins/redis-cli/redis-cli.plugin.zsh diff --git a/plugins/redis-cli/redis-cli.plugin.zsh b/plugins/redis-cli/redis-cli.plugin.zsh deleted file mode 100644 index af5a843..0000000 --- a/plugins/redis-cli/redis-cli.plugin.zsh +++ /dev/null @@ -1,4 +0,0 @@ -# add redis completion function to path -fpath=($ZSH/plugins/redis-cli $fpath) -autoload -U compinit -compinit -i From 51a7cb093b94938aec250bd3bc8177d7c01e49a5 Mon Sep 17 00:00:00 2001 From: Pat Regan Date: Thu, 28 Apr 2011 19:12:05 -0400 Subject: [PATCH 10/10] Move sourcing of custom to below plugins --- oh-my-zsh.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index c7a4c32..bf108af 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -15,9 +15,6 @@ for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath) autoload -U compinit compinit -i -# 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 for plugin ($plugins); do if [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then @@ -25,6 +22,9 @@ for plugin ($plugins); do fi done +# Load all of your custom configurations from custom/ +for config_file ($ZSH/custom/*.zsh) source $config_file + # Load the theme source "$ZSH/themes/$ZSH_THEME.zsh-theme"