]> src.twobees.de Git - dotfiles.git/blob - stow/oh-my-zsh/.oh-my-zsh/plugins/direnv/direnv.plugin.zsh
initial
[dotfiles.git] / stow / oh-my-zsh / .oh-my-zsh / plugins / direnv / direnv.plugin.zsh
1 # Don't continue if direnv is not found
2 command -v direnv &>/dev/null || return
3
4 _direnv_hook() {
5   trap -- '' SIGINT;
6   eval "$(direnv export zsh)";
7   trap - SIGINT;
8 }
9 typeset -ag precmd_functions;
10 if [[ -z ${precmd_functions[(r)_direnv_hook]} ]]; then
11   precmd_functions=( _direnv_hook ${precmd_functions[@]} )
12 fi
13 typeset -ag chpwd_functions;
14 if [[ -z ${chpwd_functions[(r)_direnv_hook]} ]]; then
15   chpwd_functions=( _direnv_hook ${chpwd_functions[@]} )
16 fi