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.
With the default configuration, generally something like this:
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.
- Install libgit2 if you don't already have it.
- Clone this repo.
make
- Ensure you have the zsh
prompt_subst
option on (setopt prompt_subst
in yourzshrc
). - Add
RPROMPT='${$(/path/to/git_status_prompt)}'
to yourzshrc
. I like putting it in myRPROMPT
but you could add it toPROMPT
instead.
MIT