mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
migrate to top level vcsinfo support
This commit is contained in:
parent
740d547dfd
commit
538801a4db
1 changed files with 8 additions and 0 deletions
25
lib/vcsinfo.zsh
Normal file
25
lib/vcsinfo.zsh
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# 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'
|
||||
Loading…
Add table
Add a link
Reference in a new issue