Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xylous/gitstatus
zsh plugin for prompts which prints git status
https://github.com/xylous/gitstatus
git git-status gitstats gitstatus prompt zsh zsh-plugin
Last synced: 4 days ago
JSON representation
zsh plugin for prompts which prints git status
- Host: GitHub
- URL: https://github.com/xylous/gitstatus
- Owner: xylous
- License: mit
- Created: 2021-05-15T13:47:11.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-06-20T11:02:08.000Z (over 2 years ago)
- Last Synced: 2024-05-21T13:49:44.535Z (6 months ago)
- Topics: git, git-status, gitstats, gitstatus, prompt, zsh, zsh-plugin
- Language: Shell
- Homepage:
- Size: 205 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gitstatus
`gitstatus` is a plugin made for prompts - it tells you how many things have
changed since the last git commit in a repository.Example with `PS1='%F{blue}%~%F{default} $(gitstatus -i)%F{green}$%F{default} '`:
![](./screenshot.png)
## 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 me and probably a handful other people, yes.
## Getting Started
### Requirements
- zsh
- git
- awk### Installation
#### Manual
Clone this repository locally, on your machine, for example:
```
git clone "https://github.com/xylous/gitstatus.git" gitstatus
``````zsh
source /path/to/installation/gitstatus.plugin.zsh
```And of course, remember to replace `/path/to/installation` with the actual path
to the program.#### With a plugin manager
You could also use a plugin manager, such as zpm:
```
zpm load xylous/gitstatus
```## Usage
Change your prompt to include `$(gitstatus)` wherever you need. Note that you'll
need to `setopt PROMPT_SUBST` and that you're going to need to use single
quotes.So, for example:
```zsh
setopt PROMPT_SUBST
PROMPT='%F{blue}%~%F{default} $(gitstatus -i)$ '
```### Options
- `-i`: use if your prompt is inline. It appends a whitespace character if the
output is non-empty; the formatting will always be proper, even if outside a git
repository.## Roadmap
- [x] add screenshots
- [x] have better support for inline prompts
- [ ] cover more `git status` flags## Contributing
Pull requests and issues are welcome.