Add project manager module

This commit is contained in:
crater2150 2017-10-23 10:28:55 +02:00
parent 5cdd11b655
commit 4ceed76221
3 changed files with 65 additions and 12 deletions

View file

@ -116,8 +116,14 @@ function setprompt() {
#middle info line
if mod_loaded vcs; then
middleline+=( "${rpscolor}${PR_VBAR} $(vcs_char) ${vcs_info_msg_0_}${reset}" )
middleline+=( "${rpscolor}${PR_VBAR} ")
if mod_loaded vcs && [[ -n ${vcs_info_msg_0_} ]]; then
middleline+=( "$(vcs_char) ${vcs_info_msg_0_}${reset}" )
fi
if mod_loaded project && [[ -n $ZPROJECT ]]; then
middleline+=( "${pathcolor}❰${ZPROJECT[name]}❱${reset}" )
fi
i_width=${(S)middleline//\%\{*\%\}} # search-and-replace color escapes
@ -128,7 +134,7 @@ function setprompt() {
lines+=( ${(j::)infoline} )
[[ -n ${vcs_info_msg_0_} ]] && lines+=( "${middleline}${filler}${rpscolor}${PR_VBAR}" )
[[ $#middleline > 1 ]] && lines+=( "${middleline}${filler}${rpscolor}${PR_VBAR}" )
lines+=( "${CORNER_LD}${PVPREFIX} %(1j.${rpscolor}%j${reset} .)${usercolor}%#${reset} " )
### Finally, set the prompt