

Switching to a Zsh Shell - davidblair
http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/

======
compay
I spend a lot of time on the command line, and personally find having that
much info in my prompt _incredibly_ distracting. I would really prefer to
leave things like battery monitoring to my OS or Window Manager - not my shell
prompt. The screenshots in this article look like the kind of stuff that you
do when you're just starting with a new piece of technology and you want to
use every single feature just to play around. Cool and fun, but at the end of
the day perhaps not very useful.

~~~
stevelosh
Actually I had most of that information in my bash prompt before I switched to
Zsh (the battery level and repo-characters are the only things that are really
new).

To get to that point I'd been poking around and tweaking for somewhere around
4-5 years, so no, it's not just a case of wanting to use as much of Zsh as
possible. Actually very little of that prompt is Zsh-specific.

You might find it distracting, that's fine. I don't. My eyes/brain have
adapted to recognize the prompt line(s) as a whole unit. I don't read every
single item every single time I see the prompt. But when I _do_ need a piece
of information it's right there in front of me and my eyes can home in on it
quickly thanks to the color-coding.

Examples:

When I'm switching directories a lot (maybe I'm setting up a new project and
installing plugins) my eyes tend to focus on the green text in the center
(current directory).

When I'm merging translation branches for hgtip.com's content repository my
eyes focus on the magenta text near the right (the current branch).

When I'm using MQ a lot my eyes focus on the list of MQ patches.

The "dirty" flags ("?" and "!" at the right) always jump right out at me if
they're there, because they're a different color than the text to the left of
them and there's not even a space as a separator.

------
robbyrussell
Steve is using Oh My Zsh, which is one of my pet projects. You can find it on
Github.

<http://github.com/robbyrussell/oh-my-zsh>

------
burke
I like having extra information in my prompt, but not to the point that it
takes up a whole line of its own. Here's what mine looks like:
<http://grab.by/26hX>

~~~
stevelosh
What do the special characters represent?

~~~
burke
The first one is git status: Magenta means there are unstaged changes, cyan
means there aren't. Star is master, I have different symbols for a few
different branches I use on some projects. Otherwise, that symbol just shows
as the branch name.

The second symbol is my currently-active ruby interpreter.

EDIT: see <http://github.com/burke/dotfiles/tree/master/.config.d/zsh>

------
flashingpumpkin
To be honest, most of that stuff works just fine in BASH too.

<http://gist.github.com/277975>

That's my bash prompt, doing the same. Except, it doesn't factor in mercurial
repositories, but that'll be a breeze to add.

Displaying: (<virtual_env>) user@host [ <folder> ~<branch> <* available
changes>]$

~~~
stevelosh
Oh yeah, definitely. Like I mentioned in the post it _could_ be pretty easily
converted to bash (except for the RPROMPT), I just haven't gotten around to
doing it.

------
kree10
There's a more general solution for putting VCS information in your zsh prompt
called vcs_info. I don't know if it covers all the features of these hg and
git prompts, but it does support svn and cvs (among others), which I still
have to use for some projects.

[http://zsh.sourceforge.net/Doc/Release/User-
Contributions.ht...](http://zsh.sourceforge.net/Doc/Release/User-
Contributions.html#SEC273)

~~~
stevelosh
Yeah, I've seen vcs_info around before. It's exactly like you said -- it
supports more VCSes and it's quicker to set up than hand-rolling your own, but
it's less flexible.

------
mrud
For a good zsh configuration have a look at <http://grml.org/zsh/> (vcs_dir
enabled prompt, persistend dir stack, directory based profile and many more)

For a general zsh overview have a look at <http://grml.org/zsh/zsh-
lovers.html>

