This is is a zsh optimized version of autoenv
chpwd_functions
Using antigen
antigen-bundle Tarrasch/zsh-autoenv
The code was mostly copied from Joshua Clayton