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

Git info in right prompt



Hi,

I'd like to display the current git branch in the right prompt,
similar to what's shown here:

  http://news.ycombinator.com/item?id=767485

But I'm having a hard time making out what's being suggested for
the zshrc (partially due to poor formatting), maybe this? :

  # precmd is called just before the prompt is printed
  function
  precmd() { title "zsh" "$USER@%m" "%55<...<%~"
  psvar=()
  vcs_info
  [[ -n $vcs_info_msg_0_ ]] && psvar[1]="$vcs_info_msg_0_"
  }

  vcs_info export RPS1="${YELLOW}%1v${NORM}"

But I don't think that's quite right...and I can't seem to make any
"display git branch" thing work with my current prompt:

  PS1=$'%{\e[01;32m%} %~ %{\e[01;33m%}%# %{\e[0m%}'

TIA for any help,

John


-- 
John Magolske
http://B79.net/contact



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