aboutsummaryrefslogtreecommitdiffstats
path: root/zsh
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2015-04-16 11:19:39 +0200
committerJohannes Löthberg <johannes@kyriasis.com>2015-04-16 11:22:15 +0200
commitf6d1867142635e9df7b2f6fd7df4ff4cfbc4c727 (patch)
tree7d86b1278bf6604eb7f98290145cf45225fa8286 /zsh
parent3ec21e09db49713fcdfa61815ab15d9a75a8591c (diff)
downloaddotfiles-f6d1867142635e9df7b2f6fd7df4ff4cfbc4c727.tar.xz
zsh/prompt: Add virtual env to prompt
Diffstat (limited to 'zsh')
-rw-r--r--zsh/prompt.zsh13
1 files changed, 9 insertions, 4 deletions
diff --git a/zsh/prompt.zsh b/zsh/prompt.zsh
index f629be0..67e17b4 100644
--- a/zsh/prompt.zsh
+++ b/zsh/prompt.zsh
@@ -24,25 +24,30 @@ bg[blue]='%K{21}'
fg[light_blue]='%F{blue}'
fg[blue]='%F{21}'
+function virtualenv_prompt {
+ if [[ -n "$VIRTUAL_ENV" ]]; then
+ print "$bg[light_blue]$fg[white] $(basename $VIRTUAL_ENV) %f%k"
+ fi
+}
if (( UID == 0 )); then
- PROMPT='$bg[light_red] $fg[white]%m%f %k$bg[white]$fg[light_red] %~ %f%k
+ PROMPT='$bg[light_red] $fg[white]%m%f %k$bg[white]$fg[light_red] %~ %f%k$(virtualenv_prompt)
$bg[light_blue]%B ^_^ %b%k '
else
case $SHORTHOST in
"theos")
- PROMPT='$bg[light_pink] $fg[white]%m%f %k$bg[white]$fg[light_pink] %~ %f%k
+ PROMPT='$bg[light_pink] $fg[white]%m%f %k$bg[white]$fg[light_pink] %~ %f%k$(virtualenv_prompt)
$bg[light_blue]%B ^_^ %b %k'
;;
"lucifer")
- PROMPT='$bg[dark_gold] $fg[white]%m%f %k$bg[white]$fg[dark_gold] %~ %f%k
+ PROMPT='$bg[dark_gold] $fg[white]%m%f %k$bg[white]$fg[dark_gold] %~ %f%k$(virtualenv_prompt)
$bg[light_blue]%B ^_^ %b %k'
;;
*)
- PROMPT='$bg[black] $fg[white]%m%f %k$bg[white]$fg[black] %~ %f%k
+ PROMPT='$bg[black] $fg[white]%m%f %k$bg[white]$fg[black] %~ %f%k$(virtualenv_prompt)
$bg[light_blue]%B ^_^ %b %k'
;;