zsh-git-venv-prompt
is a Zsh plugin that enhances your Zsh prompt with information about the current Python virtual environment and the Git status (asynchronously). It uses zsh-async
to provide async updates for Git status and displays the virtual environment in the second line of the prompt.
- Displays the name of the active Python virtual environment (if any).
- Shows the current Git branch and changes (staged, unstaged, clean) asynchronously.
- Supports a two-line prompt:
- First line: Username, hostname, and current directory.
- Second line: Python virtual environment (if active), followed by Git status.
- zsh-async: This plugin requires
zsh-async
for asynchronous Git status updates.
You can install zsh-async
using a plugin manager like znap
:
znap source mafredri/zsh-async
To install this plugin using znap, add the following line to your .zshrc:
znap source walkingshamrock/zsh-git-venv-prompt/zsh-git-venv-prompt.plugin.zsh
- Clone the repository to your ~/.zsh/plugins/ directory:
git clone https://github.com/walkingshamrock/zsh-git-venv-prompt.git ~/.zsh/plugins/zsh-git-venv-prompt
- Add the following line to your .zshrc:
source ~/.zsh/plugins/zsh-git-venv-prompt/zsh-git-venv-prompt.plugin.zsh
- Reload your .zshrc:
source ~/.zshrc
The plugin automatically configures a two-line prompt:
- First line: Displays your username, hostname, and current directory.
- Second line: Displays the Python virtual environment (if active), followed by Git branch and status.
You can modify the prompt by changing the PROMPT variable in the zsh-git-venv-prompt.plugin.zsh file.
Once installed, the plugin will automatically display:
- The name of the currently active Python virtual environment (if any).
- The current Git branch and status asynchronously: - + for staged changes. - * for unstaged changes. - ✔ for clean status. For example, your prompt will look like this:
user@hostname /path/to/dir (main) + * ✔
(venv) %
Contributions are welcome! If you find a bug or have an improvement, please open an issue or submit a pull request.
Special thanks to pure for their inspiration and influence in designing the shell prompts.
This plugin is licensed under the MIT License. See the LICENSE file for details.