aboutsummaryrefslogtreecommitdiff
path: root/.zshrc
diff options
context:
space:
mode:
Diffstat (limited to '.zshrc')
-rw-r--r--.zshrc11
1 files changed, 10 insertions, 1 deletions
diff --git a/.zshrc b/.zshrc
index 63a89a1..347f3c0 100644
--- a/.zshrc
+++ b/.zshrc
@@ -126,6 +126,14 @@ function precmd() # {{{
sshd|*/sshd|mosh*) HOSTNAME_COLOR="%F{6}" ;;
esac
# }}}
+
+ # Color last directory name in case of python venv
+ PROMPT_PATH='%F{4}%~%k'
+
+ if [[ -n "$PYTHON_VENV_DIR" ]]
+ then
+ PROMPT_PATH+='%F{6}#'"$(awk -F/ '{ print $(NF-1) }' <<< "$PYTHON_VENV_DIR")"
+ fi
}
# }}}
@@ -162,7 +170,8 @@ PROMPT='%(!.%F{1}.%F{2})%n%F{8}'
PROMPT=$PROMPT'@'
PROMPT=$PROMPT'${HOSTNAME_COLOR}%M%F{8}'
PROMPT=$PROMPT':'
-PROMPT=$PROMPT'%F{4}%~%k${PGIT}'
+PROMPT=$PROMPT'${PROMPT_PATH}'
+PROMPT=$PROMPT'%k${PGIT}'
PROMPT=$PROMPT' '
PROMPT=$PROMPT'%(?.%F{7}.%F{1})${EXITCODE}%k'
PROMPT=$PROMPT' ${vi_mode}ยป%b %f${CURSOR_STYLE}'