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

Re: VCS_info seems really slow on remote filesystem



On Thu, Nov 7, 2019 at 7:41 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> Is there anyone more familiar than I with the implementation than I,
> who could determine whether any of this information could be cached
> instead of being regenerated on every precmd?

To partly answer my own question -- I've taken advantage of the fact
that I'm also using "prompt bart" which conveniently sets the global
variable $PSCMD.  So I just changed to this:

vcs-info-v() { [[ $PSCMD = git* ]] && vcs_info; RPS1=${vcs_info_msg_0_% } }
add-zsh-hook precmd vcs-info-v
add-zsh-hook chpwd vcs_info

and now my prompts are fast until I either change directories or run a
git command.  Would need tweaking if I were making significant use of
git aliases, but for now this suffices.



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