https://github.com/deathlyfrantic/git-status-prompt
A Git status widget for your zsh prompt, written in C
https://github.com/deathlyfrantic/git-status-prompt
c git prompt status zsh
Last synced: 8 months ago
JSON representation
A Git status widget for your zsh prompt, written in C
- Host: GitHub
- URL: https://github.com/deathlyfrantic/git-status-prompt
- Owner: deathlyfrantic
- License: mit
- Archived: true
- Created: 2017-02-28T23:25:41.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2023-03-07T12:40:43.000Z (over 2 years ago)
- Last Synced: 2024-10-24T18:33:13.991Z (about 1 year ago)
- Topics: c, git, prompt, status, zsh
- Language: C
- Size: 4.88 KB
- Stars: 6
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Git Super Status II Turbo: Hyper Fighting
A blatant rip-off of [Git Super Status](https://github.com/olivierverdier/zsh-git-prompt), but written in C, using
[libgit2](https://libgit2.github.com/).
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:

### 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
0. Install libgit2 if you don't already have it.
1. Clone this repo.
2. `make`
3. Ensure you have the zsh `prompt_subst` option on (`setopt prompt_subst` in your `zshrc`).
4. 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