🐙 Got git support in zsh prompt.

So for a while I was enjoying my prompt like this:

which is neat, simple and minimal. And still I cant describe how much I love it. This is how I configured it.

It contains mainly three elements. Thats all. However, no matter how beautiful and elegant your prompt look like its of no use if it doesnt have git status.

Adding Git status support

Thanks to my friend bot he gave me heads up about vcs_info.

ZSH comes with a nice package vcs_info that give all git information.

By default, vcs_info comes with lots of info that I dont need, and I only needed branch information.

To be able to use ${vcs_info_msg_0_} directly in your prompt like this, you will need to have the PROMPT_SUBST option enabled.

And this is the final prompt code:

Now my prompt look like this when inside in git folder:

References:

zsh lover
<< back