From 4ca6bb9316793f5c0a6ced7e0c9c5196fd9275d5 Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Wed, 19 Dec 2018 13:34:46 +1100 Subject: [PATCH] Enable support for direnv/direnv in interactive Zshells --- config/zsh/interactive/direnv | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 config/zsh/interactive/direnv diff --git a/config/zsh/interactive/direnv b/config/zsh/interactive/direnv new file mode 100644 index 0000000..49e16f6 --- /dev/null +++ b/config/zsh/interactive/direnv @@ -0,0 +1,8 @@ +#! zsh +_direnv_hook() { + eval "$(direnv export zsh)" +} +typeset -ag precmd_functions +if (( $+commands[direnv] )) && [[ -z ${precmd_functions[(r)_direnv_hook]} ]]; then + precmd_functions+=(_direnv_hook) +fi