Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Dec 2015 09:30:34 -0800
From:      Craig Rodrigues <rodrigc@FreeBSD.org>
To:        Bartek Rutkowski <robak@freebsd.org>
Cc:        freebsd-git@freebsd.org
Subject:   Re: Put working git branch in shell prompt for bash and zsh?
Message-ID:  <CAG=rPVe8kFUZtEtHrna886hwuChhkV-dPYVeXRmNtaPA=d6mGQ@mail.gmail.com>
In-Reply-To: <5794E27D-73D5-4419-9351-52D45A5C7BFF@FreeBSD.org>
References:  <CAG=rPVeDkU2v_0Zk_JoMvYzsr1-CQpq45K7Se07KjJSfA=-3Vw@mail.gmail.com> <5794E27D-73D5-4419-9351-52D45A5C7BFF@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Dec 4, 2015 at 6:22 AM, Bartek Rutkowski <robak@freebsd.org> wrote:

> Check out 'zprezto' ZSH config framework with 'sorin' theme activated,
> you'll love it :)
>

Wow!  I love it!

Here is what I did:

(1)  Followed instructions for setting up zprezto at:
https://github.com/sorin-ionescu/prezto
(2)  In $HOME/.zshrc put this line near the top so that zprezto is properly
initialzed:

          source ~/.zprezto/init.zsh

After that, when I changed directories into a git checkout, it puts the
branch in the prompt like this:
https://goo.gl/WfLMdx

I didn't like the default prompt, because it was too "busy".
So, I did some additional customizations:

(3)  In $HOME/.zpreztorc , put this line:

zstyle ':prezto:module:prompt' theme 'minimal'

That's it!

Now I can do this:

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
~/checkouts =C2=BB cd $HOME/checkouts
~/checkouts =C2=BB pwd
/home/rodrigc/checkouts
~/checkouts =C2=BB cd m2crypto
checkouts/m2crypto - [setuptools] =C2=BB git branch
  python3_c
* setuptools
checkouts/m2crypto - [setuptools] =C2=BB git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
checkouts/m2crypto - [master] =C2=BB

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

There are a lot of blogs out there for zprezto, so obviously there
is more customization that I can do.

However, I was able to quickly get the behavior I wanted without too much
work.

Thanks!!

--
Craig



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG=rPVe8kFUZtEtHrna886hwuChhkV-dPYVeXRmNtaPA=d6mGQ>