aboutsummaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2020-05-18 08:10:33 +0300
committerromkatv <roman.perepelitsa@gmail.com>2020-05-18 08:14:08 +0300
commit6998d06a9168805a89b78ce403b70fac278d8454 (patch)
treea3bdf8457839aa427473c120e8d0d0193f7bac75 /config
parentf96c1eb5e591bc10fd2e4e5f0bcd016ab0aba809 (diff)
pyenv: display python version alongside environment name if unequal
See #730.
Diffstat (limited to 'config')
-rw-r--r--config/p10k-classic.zsh13
-rw-r--r--config/p10k-lean-8colors.zsh13
-rw-r--r--config/p10k-lean.zsh13
-rw-r--r--config/p10k-rainbow.zsh13
4 files changed, 52 insertions, 0 deletions
diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh
index 8eef2d59..4682db14 100644
--- a/config/p10k-classic.zsh
+++ b/config/p10k-classic.zsh
@@ -873,6 +873,19 @@
typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false
# If set to false, hide python version if it's equal to "system".
typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true
+
+ # Pyenv segment format. The following parameters are available within the expansion.
+ #
+ # - P9K_CONTENT Current pyenv environment (pyenv version-name).
+ # - P9K_PYENV_PYTHON_VERSION Current python version (python --version).
+ #
+ # The default format has the following logic:
+ #
+ # 1. Display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION" if $P9K_PYENV_PYTHON_VERSION is not
+ # empty and unequal to $P9K_CONTENT.
+ # 2. Otherwise display just "$P9K_CONTENT".
+ typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_PYENV_PYTHON_VERSION:#$P9K_CONTENT}:+ $P9K_PYENV_PYTHON_VERSION}'
+
# Custom icon.
# typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh
index 1c1c9141..240009a3 100644
--- a/config/p10k-lean-8colors.zsh
+++ b/config/p10k-lean-8colors.zsh
@@ -850,6 +850,19 @@
typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false
# If set to false, hide python version if it's equal to "system".
typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true
+
+ # Pyenv segment format. The following parameters are available within the expansion.
+ #
+ # - P9K_CONTENT Current pyenv environment (pyenv version-name).
+ # - P9K_PYENV_PYTHON_VERSION Current python version (python --version).
+ #
+ # The default format has the following logic:
+ #
+ # 1. Display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION" if $P9K_PYENV_PYTHON_VERSION is not
+ # empty and unequal to $P9K_CONTENT.
+ # 2. Otherwise display just "$P9K_CONTENT".
+ typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_PYENV_PYTHON_VERSION:#$P9K_CONTENT}:+ $P9K_PYENV_PYTHON_VERSION}'
+
# Custom icon.
# typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh
index 69c1464d..ea78f5ce 100644
--- a/config/p10k-lean.zsh
+++ b/config/p10k-lean.zsh
@@ -850,6 +850,19 @@
typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false
# If set to false, hide python version if it's equal to "system".
typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true
+
+ # Pyenv segment format. The following parameters are available within the expansion.
+ #
+ # - P9K_CONTENT Current pyenv environment (pyenv version-name).
+ # - P9K_PYENV_PYTHON_VERSION Current python version (python --version).
+ #
+ # The default format has the following logic:
+ #
+ # 1. Display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION" if $P9K_PYENV_PYTHON_VERSION is not
+ # empty and unequal to $P9K_CONTENT.
+ # 2. Otherwise display just "$P9K_CONTENT".
+ typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_PYENV_PYTHON_VERSION:#$P9K_CONTENT}:+ $P9K_PYENV_PYTHON_VERSION}'
+
# Custom icon.
# typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐'
diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh
index b7694e6c..2d8c751f 100644
--- a/config/p10k-rainbow.zsh
+++ b/config/p10k-rainbow.zsh
@@ -910,6 +910,19 @@
typeset -g POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW=false
# If set to false, hide python version if it's equal to "system".
typeset -g POWERLEVEL9K_PYENV_SHOW_SYSTEM=true
+
+ # Pyenv segment format. The following parameters are available within the expansion.
+ #
+ # - P9K_CONTENT Current pyenv environment (pyenv version-name).
+ # - P9K_PYENV_PYTHON_VERSION Current python version (python --version).
+ #
+ # The default format has the following logic:
+ #
+ # 1. Display "$P9K_CONTENT $P9K_PYENV_PYTHON_VERSION" if $P9K_PYENV_PYTHON_VERSION is not
+ # empty and unequal to $P9K_CONTENT.
+ # 2. Otherwise display just "$P9K_CONTENT".
+ typeset -g POWERLEVEL9K_PYENV_CONTENT_EXPANSION='${P9K_CONTENT}${${P9K_PYENV_PYTHON_VERSION:#$P9K_CONTENT}:+ $P9K_PYENV_PYTHON_VERSION}'
+
# Custom icon.
# typeset -g POWERLEVEL9K_PYENV_VISUAL_IDENTIFIER_EXPANSION='⭐'