gitbash theme for zsh
October 11, 2022 · View on GitHub
A zsh prompt theme that mimics the default prompt from Git for Windows.

Quick setup
- Clone this repo somewhere, for example
~/repos/gitbash-zsh-theme. - Add the following to your
~/.zshrc:
fpath=(~/repos/gitbash-zsh-theme/functions $fpath)
autoload -U promptinit
promptinit
prompt gitbash
Replace ~/repos/gitbash-zsh-theme with wherever you cloned this repo.
Customization
Love git bash, but hate MINGW64? Well, lucky for you, you can change
it to whatever you want. prompt gitbash takes one argument, which
allows customizes this string:
prompt gitbash 'Your string here!'
Full installation instructions
This prompt is built using zsh's awesome prompt theme system. There's a few things that the prompt theme system needs:
First, a file called prompt_$THEME_setup to be somewhere on your
$fpath. You can either copy functions/prompt_gitbash_setup
to a directory on your current $fpath (Protip! Check which directories
are on your $fpath with typeset -p fpath) or append this repo's
functions dir to your $fpath (recommended).
Then you need to initialize the prompt system:
autoload -U promptinit
promptinit
Finally, you can use the prompt command to choose any prompt in your
$fpath. You can list all the prompts available with:
prompt -l
You can preview prompts with:
prompt -p $THEME
Or preview all prompts with:
prompt -p
You can even change themes during sessions:
prompt gitbash
prompt restore
Inspiration
I used the file from the Git for Windows installation, namely, git-prompt.sh.
# License
© 2022 Eddie Antonio Santos. MIT licensed.