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

Re: vcs_info problem



Simon Ruderich <simon@xxxxxxxxxxxx>:
> I'm using Zsh 4.3.9 and trying to use vcs_info. I added the following to my
> .zshrc as documented in zshcontrib.
> 
>     autoload -Uz vcs_info
> 
>     zstyle ':vcs_info:*' actionformats \
>         '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
>     zstyle ':vcs_info:*' formats       \
>         '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{5}]%f '
>     zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r'
>     precmd () { vcs_info }
>     PS1='%F{5}[%F{2}%n%F{5}] %F{3}%3~ ${vcs_info_msg_0_}'"%f%# '
                     here is your unmatched double quote --^

> But it gives me the this error.
> 
>     /.zshrc:358: unmatched "
> 
> So I tried a simpler approach:
> 
>     autoload -Uz vcs_info
> 
>     precmd () { vcs_info }
>     PS1='${vcs_info_msg_0_}'
> 
> But if I use this vcs_info_msg_0_ is not expanded and stays in the prompt all
> the time.

If you want to use $vcs_info_msg_0_ like this, you will need to use:
    setopt promptsubst

Regards, Frank

-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925



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