1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2025-06-14 10:51:41 +00:00

[Fix #88] Allow arbitrary git-info formats

The terms 'prompt' and 'rprompt' are not always appropriate.
A multi-line theme may choose 'line-one' and 'line-two' instead.

@ColinHebert contributed to this commit.
This commit is contained in:
Sorin Ionescu
2012-04-04 18:55:15 -04:00
parent 342f6e94a3
commit aa0c1faa19
2 changed files with 24 additions and 29 deletions

View File

@ -41,12 +41,14 @@ function prompt_sorin_setup {
zstyle ':omz:module:git' stashed ' %%B%F{cyan}✭%f%%b'
zstyle ':omz:module:git' unmerged ' %%B%F{yellow}═%f%%b'
zstyle ':omz:module:git' untracked ' %%B%F{white}◼%f%%b'
zstyle ':omz:module:git' prompt ' %F{blue}git%f$(coalesce "%b" "%p" "%c")%s'
zstyle ':omz:module:git' rprompt '%A%B%S%a%d%m%r%U%u'
zstyle ':omz:module:git' info \
'prompt' ' %F{blue}git%f$(coalesce "%b" "%p" "%c")%s' \
'rprompt' '%A%B%S%a%d%m%r%U%u'
PROMPT='%F{cyan}%1~%f${(e)git_prompt_info} %(!.%B%F{red}#%f%b.%B%F{green}%f%b) '
RPROMPT='${editor_keymap_info}%(?:: %F{red}⏎%f)${VIM:+" %B%F{green}V%f%b"}${git_rprompt_info}'
PROMPT='%F{cyan}%1~%f${(e)git_info[prompt]} %(!.%B%F{red}#%f%b.%B%F{green}%f%b) '
RPROMPT='${editor_keymap_info}%(?:: %F{red}⏎%f)${VIM:+" %B%F{green}V%f%b"}${git_info[rprompt]}'
SPROMPT='zsh: correct %F{red}%R%f to %F{green}%r%f [nyae]? '
}
prompt_sorin_setup "$@"