aboutsummaryrefslogtreecommitdiff
path: root/dot.zshrc.from_grml
diff options
context:
space:
mode:
authorThomas Schneider <qsx@chaotikum.eu>2026-07-27 19:00:40 +0200
committerThomas Schneider <qsx@chaotikum.eu>2026-07-27 20:02:39 +0200
commite5257f257d77a8b5374d886066c4d6e3a4c8b0bf (patch)
tree19e31416b2dbe985f1bfd0c0a57479fa852bf29f /dot.zshrc.from_grml
parente9b84ab128e7534621e2346f570fb0b824b4ccd3 (diff)
zsh: Add esp-idf and perl local::lib to virtualenv prompt
Diffstat (limited to 'dot.zshrc.from_grml')
-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
+}