Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Git info in right prompt

* Dirk-Jan C. Binnema <djcb.bulk@xxxxxxxxx> [100102 15:52]:
> >>>>> "John" == John Magolske <listmail@xxxxxxx> writes:
> John> I'd like to display the current git branch in the right prompt,
> John> ...
> John> ... and I can't seem to make any "display git branch" thing work
> Below is my setup for my prompts; it's a bit *more* than what you ask
> for, but it is hopefully helpful.

Thanks, 'tis more than what I need at the moment, but it'll be handy
to refer to over time for sure. Here's what I've settled on for now:

  autoload -Uz vcs_info
  precmd () {
      [[ -n $vcs_info_msg_0_ ]] && psvar[1]="$vcs_info_msg_0_"
  export PROMPT="%B%F{green} %~%(1v.%b%F{yellow}%1v%f.) %B%F{yellow}%# %b%F{white}"

However, for some reason the git info will appear in my prompt only
if I do something like `mv /etc/zsh/zshrc /etc/zsh/zshrc-1`
Seems something in the zshrc that came with the Grml distro I'm
using is preventing the display of git info (or maybe I'm just doing
something wrong). I tried reading through and commenting out various
sections of that zshrc to figure out what might be causing this
interaction to no avail. Any ideas?


John Magolske

Messages sorted by: Reverse Date, Date, Thread, Author