Skip to content

eddieantonio/gitbash-zsh-theme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

gitbash theme for zsh

A zsh prompt theme that mimics the default prompt from Git for Windows.

An uncanny recreation of git bash's default theme on Windows, complete with the inexplicable “MINGW64” string

Quick setup

  1. Clone this repo somewhere, for example ~/repos/gitbash-zsh-theme.
  2. 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.

About

A zsh prompt theme that mimics git bash.

Topics

Resources

License

Stars

Watchers

Forks

Languages