/git-status-prompt

A Git status widget for your zsh prompt, written in C

Primary LanguageCMIT LicenseMIT

Git Super Status II Turbo: Hyper Fighting

A blatant rip-off of Git Super Status, but written in C, using libgit2.

This version aims to replicate the output of the former (nearly*) exactly, but be a bit faster at doing it. My ultra-scientific testing shows this version is a little over 3x as fast. When you want to display your git repo status in your prompt, every microsecond matters.

* this version shows the number of untracked files, whereas the original simply shows whether there are untracked files.

What does it look like

With the default configuration, generally something like this:

example output

Configuration

Have a look at the configuration section in gitprompt.c and define the macros to be whatever you like. They're currently set up to defaults I find pleasant. Note the color definitions are zsh-specific but I'm sure they can be modified to work in Bash or Fish or whatever.

How to use

  1. Install libgit2 if you don't already have it.
  2. Clone this repo.
  3. make
  4. Ensure you have the zsh prompt_subst option on (setopt prompt_subst in your zshrc).
  5. Add RPROMPT='${$(/path/to/git_status_prompt)}' to your zshrc. I like putting it in my RPROMPT but you could add it to PROMPT instead.

License

MIT