# Enabling and setting git info var to be used in prompt config.
autoload -Uz vcs_info
zstyle ':vcs_info:*' enable git svn
# This line obtains information from the vcs.
zstyle ':vcs_info:git*' formats " - (%b)"
precmd() {
vcs_info
}
# Enable substitution in the prompt.
setopt prompt_subst
# Config for the prompt. PS1 synonym.
prompt='$ %1/${vcs_info_msg_0_} %% '
Mac重新修改terminal显示git分支(show git branch prompt)
最新推荐文章于 2024-09-05 11:24:26 发布