Does anyone know how to do this? I need/want my right prompt to display time when I'm outside a git directory, and I want it to show the branch when I'm inside a git dir.
This is the config I use, extracted from git doc:
autoload -Uz vcs_info
precmd_vcs_info() { vcs_info }
precmd_functions+=( precmd_vcs_info )
setopt prompt_subst
RPROMPT=\$vcs_info_msg_0_
zstyle ':vcs_info:git:*' formats '%b'
But want to use RPROMPT="%*"
when outside git dir.