From cb1e1b6b4a65f305a326517e2fe73e268ce611c7 Mon Sep 17 00:00:00 2001 From: Nathan Lloyd Ward Date: Sun, 29 Dec 2024 14:22:25 -0500 Subject: [PATCH] Update dot_zshrc --- chezmoi/dot_zshrc | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/chezmoi/dot_zshrc b/chezmoi/dot_zshrc index f3b658b..e2e6fa4 100644 --- a/chezmoi/dot_zshrc +++ b/chezmoi/dot_zshrc @@ -12,21 +12,6 @@ export PATH="/usr/local/bin:/usr/local/sbin:${HOME}/.local/bin:$PATH" export XDG_DATA_DIRS="$XDG_DATA_DIRS:/var/lib/flatpak/exports/share:/root/.local/share/flatpak/exports/share" -_direnv_hook() { - trap -- '' SIGINT - eval "$("/nix/store/3mydh7746lji25ry2aygsy5i4s0i23x2-direnv-2.35.0/bin/direnv" export zsh)" - trap - SIGINT -} -typeset -ag precmd_functions -if (( ! ${precmd_functions[(I)_direnv_hook]} )); then - precmd_functions=(_direnv_hook $precmd_functions) -fi -typeset -ag chpwd_functions -if (( ! ${chpwd_functions[(I)_direnv_hook]} )); then - chpwd_functions=(_direnv_hook $chpwd_functions) -fi - - if [ -z "$VIRTUAL_ENV" ]; then echo "No virtual environment is active. Activating $VENV_DIR..." # Activate the virtual environment @@ -41,3 +26,16 @@ else echo "Virtual environment already active: $VIRTUAL_ENV" fi +_direnv_hook() { + trap -- '' SIGINT + eval "$("/nix/store/3mydh7746lji25ry2aygsy5i4s0i23x2-direnv-2.35.0/bin/direnv" export zsh)" + trap - SIGINT +} +typeset -ag precmd_functions +if (( ! ${precmd_functions[(I)_direnv_hook]} )); then + precmd_functions=(_direnv_hook $precmd_functions) +fi +typeset -ag chpwd_functions +if (( ! ${chpwd_functions[(I)_direnv_hook]} )); then + chpwd_functions=(_direnv_hook $chpwd_functions) +fi