From 1eb69e9a795cc19450178c07d8d382622bc7ad70 Mon Sep 17 00:00:00 2001 From: Pedro Pereira Date: Fri, 16 Oct 2026 15:19:13 -0300 Subject: first commit --- .../zsh/oh-my-zsh/plugins/direnv/direnv.plugin.zsh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .config/zsh/oh-my-zsh/plugins/direnv/direnv.plugin.zsh (limited to '.config/zsh/oh-my-zsh/plugins/direnv/direnv.plugin.zsh') diff --git a/.config/zsh/oh-my-zsh/plugins/direnv/direnv.plugin.zsh b/.config/zsh/oh-my-zsh/plugins/direnv/direnv.plugin.zsh new file mode 100644 index 0000000..c026dbe --- /dev/null +++ b/.config/zsh/oh-my-zsh/plugins/direnv/direnv.plugin.zsh @@ -0,0 +1,19 @@ +# If direnv is not found, don't continue and print a warning +if (( ! $+commands[direnv] )); then + echo "Warning: direnv not found. Please install direnv and ensure it's in your PATH before using this plugin." + return +fi + +_direnv_hook() { + trap -- '' SIGINT; + eval "$(direnv export zsh)"; + trap - SIGINT; +} +typeset -ag precmd_functions; +if [[ -z "${precmd_functions[(r)_direnv_hook]+1}" ]]; then + precmd_functions=( _direnv_hook ${precmd_functions[@]} ) +fi +typeset -ag chpwd_functions; +if [[ -z "${chpwd_functions[(r)_direnv_hook]+1}" ]]; then + chpwd_functions=( _direnv_hook ${chpwd_functions[@]} ) +fi -- cgit v1.3