Display pyhton version and virtualenv(i.e. pyenv) name in zsh prompt.
Switch branches/tags
Nothing to show
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
functions Update prompt when move to local pyenv directory Sep 2, 2014
img Add a screenshot Sep 2, 2014
.gitignore Initial commit Sep 2, 2014
LICENSE Add LICENSE Sep 2, 2014
README.md Fix README May 31, 2016
zshrc.zsh Fix #1 add autoload add-zsh-hook May 31, 2016

README.md

zsh-python-prompt

Display pyhton version and virtualenv name in zsh prompt.

ScreenShot01

Sample

Python: /usr/bin/python

[user@host(system@2.7.5)]$

Python: /usr/local/bin/python

[user@host(local@2.7.8)]$

Python: Use pyenv (/usr/local/bin/python)

[user@host(⌘local@2.7.8)]$ 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(⌘pyenv_test@2.7.8)]$ pyenv version
pyenv_test (set by /Users/user/hoge/fuga/pyenv_test/.python-version)

Installation

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

Customize

Change pyenv symbol.

zstyle ':zsh-python-prompt:pyenv:' symbol ''

License

MIT License