Browse Source

Merged pull request #269 from oknowton/master.

Significantly speed up startup time (1.2 seconds for me) by removing redundant compinit calls
Robby Russell 14 years ago
parent
commit
9c7951964c
  1. 3
      lib/completion.zsh
  2. 2
      lib/key-bindings.zsh
  3. 19
      oh-my-zsh.sh
  4. 4
      plugins/brew/brew.plugin.zsh
  5. 4
      plugins/cpanm/cpanm.plugin.zsh
  6. 4
      plugins/gem/gem.plugin.zsh
  7. 4
      plugins/github/github.plugin.zsh
  8. 4
      plugins/macports/macports.plugin.zsh
  9. 4
      plugins/npm/npm.plugin.zsh
  10. 4
      plugins/pip/pip.plugin.zsh
  11. 4
      plugins/redis-cli/redis-cli.plugin.zsh
  12. 3
      plugins/vagrant/vagrant.plugin.zsh

3
lib/completion.zsh

@ -8,9 +8,6 @@ setopt always_to_end @@ -8,9 +8,6 @@ setopt always_to_end
WORDCHARS=''
autoload -U compinit
compinit -i
zmodload -i zsh/complist
## case-insensitive (all),partial-word and then substring completion

2
lib/key-bindings.zsh

@ -1,6 +1,4 @@ @@ -1,6 +1,4 @@
# TODO: Explain what some of this does..
autoload -U compinit
compinit -i
bindkey -e
bindkey '\ew' kill-region

19
oh-my-zsh.sh

@ -7,12 +7,23 @@ fpath=($ZSH/functions $fpath) @@ -7,12 +7,23 @@ 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)
# Load and run compinit
autoload -U compinit
compinit -i
# Load all of the plugins that were defined in ~/.zshrc
plugin=${plugin:=()}
for plugin ($plugins) source $ZSH/plugins/$plugin/$plugin.plugin.zsh
for plugin ($plugins); do
if [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
source $ZSH/plugins/$plugin/$plugin.plugin.zsh
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"

4
plugins/brew/brew.plugin.zsh

@ -1,4 +0,0 @@ @@ -1,4 +0,0 @@
# add brew completion function to path
fpath=($ZSH/plugins/brew $fpath)
autoload -U compinit
compinit -i

4
plugins/cpanm/cpanm.plugin.zsh

@ -1,4 +0,0 @@ @@ -1,4 +0,0 @@
# add cpanm completion function to path
fpath=($ZSH/plugins/cpanm $fpath)
autoload -U compinit
compinit -i

4
plugins/gem/gem.plugin.zsh

@ -1,4 +0,0 @@ @@ -1,4 +0,0 @@
# add gem completion function to path
fpath=($ZSH/plugins/gem $fpath)
autoload -U compinit
compinit -i

4
plugins/github/github.plugin.zsh

@ -5,7 +5,3 @@ if [ "$commands[(I)hub]" ]; then @@ -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

4
plugins/macports/macports.plugin.zsh

@ -6,7 +6,3 @@ alias puni="sudo port uninstall inactive" @@ -6,7 +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)
autoload -U compinit
compinit -i

4
plugins/npm/npm.plugin.zsh

@ -1,4 +0,0 @@ @@ -1,4 +0,0 @@
# add npm completion function to path
fpath=($ZSH/plugins/npm $fpath)
autoload -U compinit
compinit -i

4
plugins/pip/pip.plugin.zsh

@ -1,4 +0,0 @@ @@ -1,4 +0,0 @@
# add brew completion function to path
fpath=($ZSH/plugins/pip $fpath)
autoload -U compinit
compinit -i

4
plugins/redis-cli/redis-cli.plugin.zsh

@ -1,4 +0,0 @@ @@ -1,4 +0,0 @@
# add redis completion function to path
fpath=($ZSH/plugins/redis-cli $fpath)
autoload -U compinit
compinit -i

3
plugins/vagrant/vagrant.plugin.zsh

@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
fpath=($ZSH/plugins/vagrant $fpath)
autoload -U compinit
compinit -i
Loading…
Cancel
Save