https://github.com/eddieantonio/gitbash-zsh-theme
A zsh prompt theme that mimics git bash.
https://github.com/eddieantonio/gitbash-zsh-theme
git-bash hacktoberfest prompt zsh zsh-prompt
Last synced: 7 months ago
JSON representation
A zsh prompt theme that mimics git bash.
- Host: GitHub
- URL: https://github.com/eddieantonio/gitbash-zsh-theme
- Owner: eddieantonio
- License: mit
- Created: 2022-10-09T22:03:51.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-11T08:50:02.000Z (almost 3 years ago)
- Last Synced: 2024-12-17T21:43:55.807Z (10 months ago)
- Topics: git-bash, hacktoberfest, prompt, zsh, zsh-prompt
- Language: Shell
- Homepage:
- Size: 39.1 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gitbash theme for zsh
A zsh prompt theme that mimics the default prompt from [Git for Windows][gitwindows].

[gitwindows]: https://gitforwindows.org/
# Quick setup
1. Clone this repo somewhere, for example `~/repos/gitbash-zsh-theme`.
2. Add the following to your `~/.zshrc`:```zsh
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:```zsh
prompt gitbash 'Your string here!'
```# Full installation instructions
This prompt is built using zsh's awesome [prompt theme system][prompt].
There's a few things that the prompt theme system needs:First, a file called `prompt_$THEME_setup` to be somewhere on your
[`$fpath`][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:
```zsh
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:```zsh
prompt -l
```You can preview prompts with:
```zsh
prompt -p $THEME
```Or preview all prompts with:
```zsh
prompt -p
```You can even change themes during sessions:
```zsh
prompt gitbash
prompt restore
```[prompt]: https://zsh.sourceforge.io/Doc/Release/User-Contributions.html#Prompt-Themes
[fpath]: https://zsh.sourceforge.io/Doc/Release/Functions.html#index-autoloading-functions# Inspiration
I used the file from the Git for Windows installation, namely, [git-prompt.sh].
[git-prompt.sh]: https://github.com/git-for-windows/git-sdk-64/blob/main/etc/profile.d/git-prompt.sh
# License
© 2022 Eddie Antonio Santos. MIT licensed.