zsh plugin for prompts which prints git status. Forked from https://github.com/xylous/gitstatus
Go to file
xylous 70cec22db5 Split large function into smaller ones
Split former `parse_git_status` function, which was around 60 lines of
code, into multiple small functions.

Also, instead of polluting the global namespace with a lot of variables,
make functions return something through a $REPLY variable. Or the
$STATUS variable, in the case of the *new* parse_git_status function.
2021-06-18 23:19:19 +03:00
LICENSE Add MIT License 2021-05-19 12:13:14 +03:00
README.md Add README.md 2021-05-19 13:32:27 +03:00
gitstatus.plugin.zsh Split large function into smaller ones 2021-06-18 23:19:19 +03:00

gitstatus.zsh

gitstatus is a zsh plugin that you can add to your prompt to help you see what you're doing in a git repository more easily.

Why such a thing?

Frankly, it's because I needed something small and fast that would integrate well with my (multi-line) prompt.

Is it useful? For myself at least, yes.

Getting Started

Requirements

  • zsh
  • git
  • awk

Installation

Run the following command:

git clone https://github.com/Insert-Creative-Name-Here/gitstatus.zsh.git

You can move the downloaded repository anywhere you want on your computer afterwards.

Usage

Add the following lines to your zshrc:

function precmd()
{
    source path/to/installation/gitstatus.plugin.zsh
}

precmd() is a zsh builtin that executes a series of commands right before the prompt is drawn.

NOTE: you will have to redefine your prompt to include the variable $GIT_STATUS, which is exported to the environment by this plugin. Something like this:

PS1="%F{blue}%~%F{default} $GIT_STATUS $ "

Roadmap

  • Find a way to not source the script every time a new prompt is drawn
  • Add bash support
  • Add screenshots

Contributing

Pull requests and issues are welcome.