mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
25 lines
629 B
Bash
25 lines
629 B
Bash
# Use the following within your prompt
|
|
# ${vcs_info_msg_0_}
|
|
#
|
|
# The style of vcs_info can be tweaked within a theme by modifying the output
|
|
# using zstyle.
|
|
#
|
|
# http://zsh.sourceforge.net/Doc/Release/User-Contributions.html#IDX2133
|
|
#
|
|
|
|
typeset -ga precmd_functions
|
|
autoload -Uz vcs_info
|
|
|
|
zstyle ':vcs_info:git:*' check-for-changes true
|
|
zstyle ':vcs_info:git:*' formats "$ZSH_THEME_GIT_PROMPT_PREFIX%b%u%F$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
|
zstyle ':vcs_info:git:*' unstagedstr "$ZSH_THEME_GIT_PROMPT_DIRTY"
|
|
|
|
zsh_vcsinfo_precmd() {
|
|
vcs_info
|
|
}
|
|
|
|
vcs_prompt_info() {
|
|
echo "${vcs_info_msg_0_}"
|
|
}
|
|
|
|
precmd_functions+='zsh_vcsinfo_precmd'
|