Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Git info in right prompt
- X-seq: zsh-users 14697
- From: John Magolske <listmail@xxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Git info in right prompt
- Date: Sat, 2 Jan 2010 01:41:12 -0800
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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