chore: use zinit to lozy-load rbenv, goenv, pyenv, and nodenv

Instead of custom made functions
This commit is contained in:
2020-10-29 00:42:00 +00:00
parent 99401519ee
commit 4941ade4fc
4 changed files with 7 additions and 58 deletions

View File

@@ -8,7 +8,7 @@
# install goenv # install goenv
zinit ice wait lucid as'program' pick'bin/goenv' from'gh' \ zinit ice wait lucid as'program' pick'bin/goenv' from'gh' \
atclone'src/configure && make -C src; ./libexec/goenv init - > .zinitrc.zsh' \ atclone'src/configure && make -C src; libexec/goenv init - > .zinitrc.zsh' \
atpull'%atclone' src'.zinitrc.zsh' nocompile'!' atpull'%atclone' src'.zinitrc.zsh' nocompile'!'
zinit light syndbg/goenv zinit light syndbg/goenv

View File

@@ -8,7 +8,8 @@
# install nodenv # install nodenv
zinit ice wait lucid as'program' pick'bin/nodenv' from'gh' \ zinit ice wait lucid as'program' pick'bin/nodenv' from'gh' \
atclone'src/configure && make -C src' atpull'%atclone' nocompile'!' atclone'src/configure && make -C src; libexec/nodenv init - > .zinitrc.zsh' \
atpull'%atclone' src'.zinitrc.zsh' nocompile'!'
zinit light nodenv/nodenv zinit light nodenv/nodenv
# install node-build # install node-build
@@ -31,24 +32,6 @@ zinit light ouchxp/nodenv-nvmrc
zinit ice wait lucid as'program' pick'bin/nodenv-package-*' from'gh' zinit ice wait lucid as'program' pick'bin/nodenv-package-*' from'gh'
zinit light nodenv/nodenv-package-rehash zinit light nodenv/nodenv-package-rehash
# lazy-load nodenv
nodenv() {
load-nodenv
nodenv "$@"
}
_nodenv() {
load-nodenv
_nodenv "$@"
}
compctl -K _nodenv nodenv
load-nodenv() {
unset -f load-nodenv _nodenv nodenv
eval "$(command nodenv init -)"
}
# ============================================================================== # ==============================================================================
# aliases # aliases
# ============================================================================== # ==============================================================================

View File

@@ -8,31 +8,14 @@
# install pyenv # install pyenv
zinit ice wait lucid as'program' pick'bin/pyenv' from'gh' \ zinit ice wait lucid as'program' pick'bin/pyenv' from'gh' \
atclone'src/configure && make -C src' atpull'%atclone' nocompile'!' atclone'src/configure && make -C src; libexec/pyenv init - > .zinitrc.zsh' \
atpull'%atclone' src'.zinitrc.zsh' nocompile'!'
zinit light pyenv/pyenv zinit light pyenv/pyenv
zinit ice wait lucid as'program' pick'plugins/python-build/bin/python-build' \ zinit ice wait lucid as'program' pick'plugins/python-build/bin/python-build' \
from'gh' id-as'pyenv/python-build' from'gh' id-as'pyenv/python-build'
zinit light pyenv/pyenv zinit light pyenv/pyenv
# lazy-load pyenv
pyenv() {
load-pyenv
pyenv "$@"
}
_pyenv() {
load-pyenv
_pyenv "$@"
}
compctl -K _pyenv pyenv
load-pyenv() {
unset -f load-pyenv _pyenv pyenv
eval "$(command pyenv init -)"
}
# ============================================================================== # ==============================================================================
# aliases # aliases
# ============================================================================== # ==============================================================================

View File

@@ -8,7 +8,8 @@
# Install rbenv # Install rbenv
zinit ice wait lucid as'program' pick'bin/rbenv' from'gh' \ zinit ice wait lucid as'program' pick'bin/rbenv' from'gh' \
atclone'src/configure && make -C src' atpull'%atclone' nocompile'!' atclone'src/configure && make -C src; libexec/rbenv init - > .zinitrc.zsh' \
atpull'%atclone' src'.zinitrc.zsh' nocompile'!'
zinit light rbenv/rbenv zinit light rbenv/rbenv
# install ruby-build # install ruby-build
@@ -19,24 +20,6 @@ zinit light rbenv/ruby-build
zinit ice wait lucid as'program' pick'bin/rbenv-each' from'gh' zinit ice wait lucid as'program' pick'bin/rbenv-each' from'gh'
zinit light rbenv/rbenv-each zinit light rbenv/rbenv-each
# lazy-load rbenv
rbenv() {
load-rbenv
rbenv "$@"
}
_rbenv() {
load-rbenv
_rbenv "$@"
}
compctl -K _rbenv rbenv
load-rbenv() {
unset -f load-rbenv _rbenv rbenv
eval "$(command rbenv init -)"
}
# ============================================================================== # ==============================================================================
# aliases # aliases
# ============================================================================== # ==============================================================================