Display pyhton version and virtualenv name in zsh prompt.
Python: /usr/bin/python
[user@host([email protected])]$
Python: /usr/local/bin/python
[user@host([email protected])]$
Python: Use pyenv (/usr/local/bin/python
)
[user@host(⌘[email protected])]$ pyenv version
system (set by /Users/user/.pyenv/version)
Python: Use pyenv (/Users/user/.pyenv/versions/2.7.8/bin/python2.7
)
[user@host(⌘@2.7.8)]$ pyenv version
2.7.8 (set by /Users/user/.pyenv/version)
Python: Use pyenv (/Users/user/.pyenv/versions/pyenv_t/bin/python
)
[user@host(⌘[email protected])]$ pyenv version
pyenv_test (set by /Users/user/hoge/fuga/pyenv_test/.python-version)
1.Source zsh-python-prompt/zshrc.zsh
file.
source /path/to/zsh-python-prompt/zshrc.zsh
2.Set the environmental variable $ZSH_PYTHON_PROMPT
to PROMPT
or RPROMPT
.
PROMPT+='$ZSH_PYTHON_PROMPT'
3.Enable environmental variables in PROMPT
.
setopt prompt_subst
Change pyenv symbol.
zstyle ':zsh-python-prompt:pyenv:' symbol '⌘'