Some years ago I posted the Gentoo Zsh prompt to make it available to every Zsh user, not only Gentoo users. Some days ago I wanted some Git features in my shell. I saw some nice prompt features in the last years when using Git so I wanted that too. I didn't found a nice prompt so I decided to write my own. I installed oh-my-zsh and created my own theme. It is based on the original Gentoo Zsh prompt and the Kolo oh-my-zsh theme.
Below you see an example session interacting with a Git repository:
Nice, isn't it?
I love minimal prompts with all the information I need. Since I am using xterm it is compatible to it. I love colors... ;)
You can see here that the [master*] part is not shown when not in a Git managed directory. My $HOME is managed by Git so I always have the repository information available, but not as root.
The code is found in my fork of the oh-my-ssh repository. Take a look under themes/, there is a file named hanez.zsh-theme. You can add this file to any oh-my-zsh installation from the upstream repositories or just add the content of the file to your .zshrc file. I use this fork only for providing my theme.
All of my custom Zsh stuff is found in my $HOME repository at GitHub.
Update: I replaced the dots which are showing the Git status with some asterisk to make the prompt become compatible to more terminal emulators. Some bugs are fixed too.
Tags: gentoo, opensource, shell, zsh, git,