From 7b6669e14db6fe6aa0c49aecaa0e094ea88049a9 Mon Sep 17 00:00:00 2001 From: thomasba Date: Thu, 29 Feb 2024 23:36:32 +0100 Subject: [PATCH] Added indicator for direnv --- zsh/commands | 5 +++++ zsh/prompt_tba_setup | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/zsh/commands b/zsh/commands index 6e1cde2..df4469b 100644 --- a/zsh/commands +++ b/zsh/commands @@ -27,6 +27,11 @@ fi alias e=$EDITOR alias :e=$EDITOR +# direnv +if command -v direnv &> /dev/null; then + eval "$(direnv hook zsh)" +fi + # aliases alias cd..='cd ..' diff --git a/zsh/prompt_tba_setup b/zsh/prompt_tba_setup index 1b663c9..b6ca9c9 100644 --- a/zsh/prompt_tba_setup +++ b/zsh/prompt_tba_setup @@ -148,6 +148,10 @@ prompt_tba_setup () { if [ -n "$SSH_CONNECTION" ] ; then IS_SSH_CONN=" ⚡" fi + IS_VENV="" + if [ -n "$VIRTUAL_ENV" ] ; then + IS_VENV=" 👻" + fi } # If I am using vi keys, I want to know what mode I'm currently using. @@ -166,7 +170,7 @@ $reset$time_color%\${PR_PWDLEN}<...<%~%<<\ $reset\ $parens├─($red\${IS_SSH_CONN}%(?.. E:%?)$green\${BAT_CHRG}$yellow\${BAT_LOW}$red\${BAT_CRIT}$text\${BAT}\${SCREEN}\${JOBS}\ -\${GITBRANCH} $parens)$reset\ +\${GITBRANCH}\${IS_VENV} $parens)$reset\ $parens└─[%(!.#.$)]${text} " PS2="$parens└─[$reset $parens%_$reset $parens]──→$reset "