Skip to content

walkingshamrock/zsh-git-venv-prompt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zsh-git-venv-prompt

Screenshot

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.

Features

  • 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.

Requirements

  • 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

Installation

Using znap (Recommended)

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

Manual Installation

  1. 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
  1. Add the following line to your .zshrc:
source ~/.zsh/plugins/zsh-git-venv-prompt/zsh-git-venv-prompt.plugin.zsh
  1. Reload your .zshrc:
source ~/.zshrc

Configuration

The plugin automatically configures a two-line prompt:

  1. First line: Displays your username, hostname, and current directory.
  2. 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.

Usage

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) %

Contributing

Contributions are welcome! If you find a bug or have an improvement, please open an issue or submit a pull request.

Acknowledgements

Special thanks to pure for their inspiration and influence in designing the shell prompts.

License

This plugin is licensed under the MIT License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages