Commit c550f1f8 authored by Robby Russell's avatar Robby Russell
Browse files

Merged pull request #269 from oknowton/master.

Significantly speed up startup time (1.2 seconds for me) by removing redundant compinit calls
parents 70d0beae 58a7cf19
...@@ -8,9 +8,6 @@ setopt always_to_end ...@@ -8,9 +8,6 @@ setopt always_to_end
WORDCHARS='' WORDCHARS=''
autoload -U compinit
compinit -i
zmodload -i zsh/complist zmodload -i zsh/complist
## case-insensitive (all),partial-word and then substring completion ## case-insensitive (all),partial-word and then substring completion
......
# TODO: Explain what some of this does.. # TODO: Explain what some of this does..
autoload -U compinit
compinit -i
bindkey -e bindkey -e
bindkey '\ew' kill-region bindkey '\ew' kill-region
......
...@@ -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 # TIP: Add files you don't want in git to .gitignore
for config_file ($ZSH/lib/*.zsh) source $config_file for config_file ($ZSH/lib/*.zsh) source $config_file
# Load all of your custom configurations from custom/ # Add all defined plugins to fpath
for config_file ($ZSH/custom/*.zsh) source $config_file 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 # Load all of the plugins that were defined in ~/.zshrc
plugin=${plugin:=()} for plugin ($plugins); do
for plugin ($plugins) source $ZSH/plugins/$plugin/$plugin.plugin.zsh 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 # Load the theme
source "$ZSH/themes/$ZSH_THEME.zsh-theme" source "$ZSH/themes/$ZSH_THEME.zsh-theme"
......
# add brew completion function to path
fpath=($ZSH/plugins/brew $fpath)
autoload -U compinit
compinit -i
# add cpanm completion function to path
fpath=($ZSH/plugins/cpanm $fpath)
autoload -U compinit
compinit -i
# add gem completion function to path
fpath=($ZSH/plugins/gem $fpath)
autoload -U compinit
compinit -i
...@@ -5,7 +5,3 @@ if [ "$commands[(I)hub]" ]; then ...@@ -5,7 +5,3 @@ if [ "$commands[(I)hub]" ]; then
function git(){hub "$@"} function git(){hub "$@"}
fi fi
# add github completion function to path
fpath=($ZSH/plugins/github $fpath)
autoload -U compinit
compinit -i
...@@ -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 puo="sudo port upgrade outdated"
alias pup="psu && puo" alias pup="psu && puo"
# add macports completion function to path
fpath=($ZSH/plugins/macports $fpath)
autoload -U compinit
compinit -i
# add npm completion function to path
fpath=($ZSH/plugins/npm $fpath)
autoload -U compinit
compinit -i
# add brew completion function to path
fpath=($ZSH/plugins/pip $fpath)
autoload -U compinit
compinit -i
# add redis completion function to path
fpath=($ZSH/plugins/redis-cli $fpath)
autoload -U compinit
compinit -i
fpath=($ZSH/plugins/vagrant $fpath)
autoload -U compinit
compinit -i
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment