In my zsh prompt i have the following:
# LOCAL/VARIABLES/GRAPHIC
local char_next=":"
# SEGMENT/VCS_STATUS_LINE
local vc_branch_name="%B%F{yellow}%i %b%f%%b"
local vc_git_staged_status="%F{green}A%f"
local vc_unstaged_status="${char_next}%F{blue}M%f"
local vc_git_untracked_status="${char_next}%F{red}U%f"
autoload -Uz vcs_info
zstyle ':vcs_info:*' enable git svn
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:git*+set-message:*' hooks use_git_untracked
zstyle ':vcs_info:git:*' stagedstr $vc_git_staged_status
zstyle ':vcs_info:git:*' unstagedstr $vc_unstaged_status
zstyle ':vcs_info:git:*' formats "${vc_branch_name} %c%u%m"
Which generates this prompt: master A:M:U, my problem with this is that whenever only one symbol is present example master :M which stands for modified files only it also prints the : symbol, how can i tell zsh to only display the char_next only when more than one symbol is present using the zstyle syntax?
I know this is possible because of this line:
PROMPT="%F{blue}%~%f`prepareGitStatusLine`
%(?.%F{yellow}.%F{red})${char_cmd}%f"
%(?.%F{yellow}.%F{red}) turn my command prompt into yellow if the last command is succesfull otherwise turn it red. Again, how can i apply something like this to the above problem using zstyle?