zsh prompt originally implemented by https://github.com/olivierverdier/zsh-git-prompt
I no longer install the Haskell toolchain everywhere so am trying to implement that prompt in Rust.
Installation
Install zsh-git-prompt-rs via cargo:
Development
The justfile is the source of truth for build/test/lint. CI runs just ci; run the same locally before pushing:
CI runs on Forgejo Actions (.forgejo/workflows/ci-linux.yml) and checks formatting, clippy (warnings = errors), tests, and a release build. The Rust toolchain is pinned in rust-toolchain.toml and must match the toolchain: input in every workflow.
Releases
Releases are cut by pushing a vX.Y.Z tag. Forgejo Actions runs .forgejo/workflows/release.yml, which bumps the version in Cargo.toml, regenerates Cargo.lock, pushes the bump back to main, and publishes to crates.io.
Required Forgejo repo secrets (Settings → Actions → Secrets and Variables):
PAT— Forgejo personal access token withwrite:repositoryscope (used to push the version bump back tomain).CRATES_IO_TOKEN— API token from https://crates.io/settings/tokens.
The prompt supports optional Nerd Font icons for the branch symbol and stash indicator.
If you have a Nerd Font installed, you can enable them by setting
ZSH_THEME_GIT_PROMPT_BRANCH_SYMBOL and ZSH_THEME_GIT_PROMPT_STASH as shown in the example below.
In your zsh init
#
# BEGIN PROMPT
#
# enable prompt
if ; then
fi
# customize prompt
PROMPT_PRE=''
if ; then
PROMPT_PRE='%n@%m '
fi
PROMPT='${PROMPT_PRE}%{$fg_bold[cyan]%}$ZSH_THEME_CLOUD_PREFIX %{$fg[green]%}%p %{$fg[green]%}%c %{$reset_color%}$(git_super_status)%{$fg_bold[red]%}% %{$reset_color%}'
# Git prompt customization
ZSH_THEME_GIT_PROMPT_PREFIX=""
ZSH_THEME_GIT_PROMPT_SUFFIX=" "
ZSH_THEME_GIT_PROMPT_SEPARATOR=""
ZSH_THEME_GIT_PROMPT_BRANCH="%{[green]%}"
ZSH_THEME_GIT_PROMPT_BRANCH_SYMBOL="%{[cyan]%}%{%G%}" # nerd font branch icon
ZSH_THEME_GIT_PROMPT_STAGED="%{[blue]%}%{ ●%G%}"
ZSH_THEME_GIT_PROMPT_CONFLICTS="%{[red]%}%{ ✖%G%}"
ZSH_THEME_GIT_PROMPT_CHANGED="%{[yellow]%}%{ ✚%G%}"
ZSH_THEME_GIT_PROMPT_BEHIND="%{ ↓%G%}"
ZSH_THEME_GIT_PROMPT_AHEAD="%{ ↑%G%}"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{[red]%}%{ …%G%}"
ZSH_THEME_GIT_PROMPT_STASH="%{[yellow]%}%{ %G%}" # nerd font stash icon
ZSH_THEME_GIT_PROMPT_CLEAN=""
#
# END PROMPT
#