aboutsummaryrefslogtreecommitdiff
path: root/internal/p10k.zsh
diff options
context:
space:
mode:
authorMarvin Teichmann <marvin.teichmann@googlemail.com>2019-06-25 02:46:42 +0300
committerMarvin Teichmann <marvin.teichmann@googlemail.com>2019-06-25 02:46:42 +0300
commitfdbb830c9818e28fb790d1c665e5dd52208f16e6 (patch)
tree5e8454da1e05a857ee5b6474112808225d57171e /internal/p10k.zsh
parent08a26b7045feafde8eb5023c5bcf074a8ff42abc (diff)
Make virtualenv segment configurable, similar to anaconda.
The virtualenv segment can now be configured using the following Variables: set_default POWERLEVEL9K_VIRTUALENV_LEFT_DELIMITER "(" set_default POWERLEVEL9K_VIRTUALENV_RIGHT_DELIMITER ")" The new defaults are chosen to resemble the standard virtualenv prompt configuration. The variable names are choosen analogous to the anaconda segment. This implements the bhilburn/powerlevel9k#345 pr.
Diffstat (limited to 'internal/p10k.zsh')
-rwxr-xr-xinternal/p10k.zsh4
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 3a7cf9b8..1a5530c0 100755
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -1944,13 +1944,15 @@ prompt_vi_mode() {
# More information on virtualenv (Python):
# https://virtualenv.pypa.io/en/latest/
set_default POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION true
+set_default POWERLEVEL9K_VIRTUALENV_LEFT_DELIMITER "("
+set_default POWERLEVEL9K_VIRTUALENV_RIGHT_DELIMITER ")"
prompt_virtualenv() {
[[ -n $VIRTUAL_ENV ]] || return
local msg=''
if [[ $POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION == true ]] && _p9k_python_version; then
msg="$_P9K_RETVAL "
fi
- msg+=${${VIRTUAL_ENV:t}//\%/%%}
+ msg+="$POWERLEVEL9K_VIRTUALENV_LEFT_DELIMITER${${VIRTUAL_ENV:t}//\%/%%}$POWERLEVEL9K_VIRTUALENV_RIGHT_DELIMITER"
"$1_prompt_segment" "$0" "$2" "blue" "$DEFAULT_COLOR" 'PYTHON_ICON' 0 '' "$msg"
}