zsh-lazyenv icon indicating copy to clipboard operation
zsh-lazyenv copied to clipboard

Environments for lazy load commands and speed up start up time of zsh

zsh-lazyenv

zsh plugin for lazy load envs and caching.
speed up start up time of zsh!!

Main fork from lazyload, evalcache.

env forks

Usage

Lazy Environments

lazyenv-enabled

Target of Environments

lazy functions

Lazy Load

lazyload <load-command> <command-name...>

Examples

lazyload 'source "$(brew --prefix nvm)/nvm.sh"' nvm

Load functions prefixed with init: will be unloaded by lazyload after first usage

load:nvm(){
    source "$(brew --prefix nvm)/nvm.sh"
}
lazyload init:nvm nvm

Eval Cache

evalcache <command> <generation args...>

Examples

eval "$(hub alias -s)" to _evalcache hub alias -s

Options

  • $ZSH_EVALCACHE_DIR: cache files storage, default $HOME/.zsh-evalcache.
  • $ZSH_EVALCACHE_DISABLE: set to true if you wish to bypass evalcache.

Install

zgem

zgem bundle 'https://github.com/black7375/zsh-lazyenv.git' from:'git' use:'zsh-lazyenv.zsh'

zplugin

zplugin load black7375/zsh-lazyenv

zgen

zgen load black7375/zsh-lazyenv
zgen save

Antigen

antigen bundle black7375/zsh-lazyenv
antigen apply

Oh My ZSH! custom plugin

git clone https://github.com/black7375/zsh-lazyenv $ZSH_CUSTOM/plugins/zsh-lazyenv
plugins+=(zsh-lazyenv)

zplug

zplug "black7375/zsh-lazyenv"

manually

git clone https://github.com/black7375/zsh-lazyenv.git
source zsh-lazyenv/zsh-lazyenv.zsh