Compiling Programs
zplugin ice as"program" atclone"rm -f src/auto/config.cache; ./configure" \
atpull"%atclone" make pick"src/vim"
zplugin light vim/vim
as"program"– add file selected bypick''to$PATH, do not source it,atclone"..."– execute code after downloading,atpull"%atclone"– execute the same codeatclone''is given, but after successful update,make– runmakeafteratclone''andatpull''.make'!'will execute before them,pick"src/vim"– set executable flag onsrc/vim, hint thatsrc/should be added to$PATH.
zplugin ice as"program" make'!' atclone'./direnv hook zsh > zhook.zsh' \
atpull'%atclone' src"zhook.zsh"
zplugin light direnv/direnv
make'!'– executemakebeforeatclone''and beforeatpull''(seemakeabove),src"zhook.zsh"– source filezhook.zsh.
Direnv is hooked up to Zsh. The code that does this is provided by program direnv (build by make''). Above atclone'' puts this code into file zhook.zsh, src'' sources it. This way direnv hook zsh is executed only on clone and update, and Zsh starts faster.