Reputation: 87
I'm trying to add vcs_info hooks to my .zshrc but not even the debug option yields output and I haven't been able to figure out why - any hints?
Sources:
vcs_info examples
shouse .zsh prompt
Excerpt from my .zshrc:
setopt prompt_subst
autoload -Uz vcs_info
zstyle ':vcs_info:*+*:*' debug true
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:git*:*' get-revision true
zstyle ':vcs_info:git*:*' check-for-changes true
zstyle ':vcs_info:git*' formats '%b'
zstyle ':vcs_info:git*' actionformats '%b:%a'
zstyle ':vcs_info:git*+set-message:*' hooks foobar
function +vi-foobar() { echo "foobar" }
function prompt_precmd() { vcs_info }
function set_prompt { PROMPT="${vcs_info_msg_0_}" }
autoload -U add-zsh-hook
add-zsh-hook precmd prompt_precmd
add-zsh-hook precmd set_prompt
Upvotes: 2
Views: 1302
Reputation: 87
The code is fine but hooks (and the debug feature?) were added to vcs_info in zsh 4.3.11 or 4.3.12. Problem is resolved by updating zsh to one of these or later versions.
Pardon the non-existing link to the entire .zshrc, didn't realize links get stripped out of comments.
Upvotes: 2