- # it's also displayed (red).
- zstyle ':vcs_info:*' formats \
- "($green%b%u%c$default:$blue%s$default)"
- zstyle ':vcs_info:*' actionformats \
- "($green%b$default/$red%a$default:$blue%s$default)"
+ # it's also displayed (red). Also display if there are unstaged or staged
+ # (%u/%c) changes.
+ if [[ $ZSH_VERSION == (4.3.<11->|4.<4->*|<5->*) ||
+ -d ~/.zsh/functions/vcs_info ]]; then
+ zstyle ':vcs_info:*' formats \
+ "($green%b%u%c$default:$blue%s$default)"
+ zstyle ':vcs_info:*' actionformats \
+ "($green%b%u%c$default/$red%a$default:$blue%s$default)"
+ else
+ # In older versions %u and %c are not defined yet and are not
+ # correctly expanded.
+ zstyle ':vcs_info:*' formats \
+ "($green%b$default:$blue%s$default)"
+ zstyle ':vcs_info:*' actionformats \
+ "($green%b$default/$red%a$default:$blue%s$default)"
+ fi