From 48d5c841256f5bcc931b2dd8ff2bff2ce92f5e1c Mon Sep 17 00:00:00 2001 From: YounShin Kang Date: Thu, 16 Feb 2017 15:10:40 +0900 Subject: [PATCH 1/3] Fix pyenv plugin location search for homebrew. --- plugins/pyenv/pyenv.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/pyenv/pyenv.plugin.zsh b/plugins/pyenv/pyenv.plugin.zsh index aa1f9488a..5f046adce 100644 --- a/plugins/pyenv/pyenv.plugin.zsh +++ b/plugins/pyenv/pyenv.plugin.zsh @@ -7,7 +7,7 @@ _pyenv-from-homebrew-installed() { } FOUND_PYENV=0 -pyenvdirs=("$HOME/.pyenv" "/usr/local/pyenv" "/opt/pyenv") +pyenvdirs=("$HOME/.pyenv" "/usr/local/pyenv" "/opt/pyenv" "/usr/local/opt/pyenv") if _homebrew-installed && _pyenv-from-homebrew-installed ; then pyenvdirs=($(brew --prefix pyenv) "${pyenvdirs[@]}") fi From 45fef70a65ad7fba749ef62d762dcab0300235d5 Mon Sep 17 00:00:00 2001 From: YounShin Kang Date: Thu, 16 Feb 2017 15:12:18 +0900 Subject: [PATCH 2/3] Fix slow pyenv plugin issue based https://github.com/robbyrussell/oh-my-zsh/commit/daedfcab510b01d566a2dff6bc94a9e91a563a18#diff-22fdd1fcfb5b98380f344442393e1f6f --- plugins/pyenv/pyenv.plugin.zsh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/plugins/pyenv/pyenv.plugin.zsh b/plugins/pyenv/pyenv.plugin.zsh index 5f046adce..58b00f857 100644 --- a/plugins/pyenv/pyenv.plugin.zsh +++ b/plugins/pyenv/pyenv.plugin.zsh @@ -2,14 +2,11 @@ _homebrew-installed() { type brew &> /dev/null } -_pyenv-from-homebrew-installed() { - brew --prefix pyenv &> /dev/null -} - FOUND_PYENV=0 pyenvdirs=("$HOME/.pyenv" "/usr/local/pyenv" "/opt/pyenv" "/usr/local/opt/pyenv") -if _homebrew-installed && _pyenv-from-homebrew-installed ; then - pyenvdirs=($(brew --prefix pyenv) "${pyenvdirs[@]}") +if _homebrew-installed && pyenv_homebrew_path=$(brew --prefix pyenv 2>/dev/null); then + pyenvdirs=($pyenv_homebrew_path "${pyenvdirs[@]}") + unset pyenv_homebrew_path fi for pyenvdir in "${pyenvdirs[@]}" ; do From c2eab39779035939af9a1a8df382e683a1f54e5d Mon Sep 17 00:00:00 2001 From: YounShin Kang Date: Thu, 16 Feb 2017 15:36:42 +0900 Subject: [PATCH 3/3] Impove start up time based on https://github.com/robbyrussell/oh-my-zsh/commit/0ed1adeaadfc03a5abb767df5ad76a1ddd2d7c69 --- plugins/pyenv/pyenv.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/pyenv/pyenv.plugin.zsh b/plugins/pyenv/pyenv.plugin.zsh index 58b00f857..5fd3bb601 100644 --- a/plugins/pyenv/pyenv.plugin.zsh +++ b/plugins/pyenv/pyenv.plugin.zsh @@ -14,7 +14,7 @@ for pyenvdir in "${pyenvdirs[@]}" ; do FOUND_PYENV=1 export PYENV_ROOT=$pyenvdir export PATH=${pyenvdir}/bin:$PATH - eval "$(pyenv init - zsh)" + eval "$(pyenv init --no-rehash - zsh)" if pyenv commands | command grep -q virtualenv-init; then eval "$(pyenv virtualenv-init - zsh)"