From 90a5bd06ca76aff04f76a5d43a432ed9340dd78d Mon Sep 17 00:00:00 2001 From: Lorenzo Bolla Date: Sat, 26 May 2018 19:44:49 +0100 Subject: [PATCH] Prefer virtualenvwrapper_lazy (#6842) This gives much faster start up times and only loads virtualenvwrapper when needed. Fix #6839 --- plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh index 484f18c9..2a7c0b92 100644 --- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh +++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh @@ -1,6 +1,14 @@ virtualenvwrapper='virtualenvwrapper.sh' +virtualenvwrapper_lazy='virtualenvwrapper_lazy.sh' -if (( $+commands[$virtualenvwrapper] )); then +if (( $+commands[$virtualenvwrapper_lazy] )); then + function { + setopt local_options + unsetopt equals + virtualenvwrapper=${${virtualenvwrapper_lazy}:c} + source ${${virtualenvwrapper_lazy}:c} + } +elif (( $+commands[$virtualenvwrapper] )); then function { setopt local_options unsetopt equals