aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dot.zshrc.from_grml18
1 files changed, 16 insertions, 2 deletions
diff --git a/dot.zshrc.from_grml b/dot.zshrc.from_grml
index d9050ca..ac0e43e 100644
--- a/dot.zshrc.from_grml
+++ b/dot.zshrc.from_grml
@@ -1,3 +1,4 @@
+# -*- shell-script -*-
## Settings for umask
if (( EUID == 0 )); then
umask 002
@@ -8,7 +9,20 @@ fi
# Virtualenv support
function virtual_env_prompt () {
- REPLY=${VIRTUAL_ENV+(${VIRTUAL_ENV:t}) }
+ emulate -L zsh
+
+ if (( ${+VIRTUAL_ENV_PROMPT} )); then
+ REPLY="(py:${VIRTUAL_ENV_PROMPT}) "
+ elif (( ${+VIRTUAL_ENV} )); then
+ REPLY="(py:${VIRTUAL_ENV:t}) "
+ elif (( ${+IDF_PYTHON_ENV_PATH} )); then
+ REPLY="(idf:${IDF_PYTHON_ENV_PATH:t}) "
+ fi
+
+ if (( ${+PERL_LOCAL_LIB_ROOT} )); then
+ local -a dirs=( ${(s/:/)PERL_LOCAL_LIB_ROOT} )
+ REPLY+="(pl:${(@j/:/)dirs:t}) "
+ fi
}
grml_theme_add_token virtual-env -f virtual_env_prompt '%F{magenta}' '%f'
zstyle ':prompt:grml:left:setup' items rc virtual-env change-root user at host path vcs percent
@@ -71,4 +85,4 @@ plap() {
else
ls -l ${^path}/*$1*(*N)
fi
-} \ No newline at end of file
+}