diff options
Diffstat (limited to 'Functions')
-rw-r--r-- | Functions/Prompts/prompt_clint_setup | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Functions/Prompts/prompt_clint_setup b/Functions/Prompts/prompt_clint_setup index 154edede1..ba55ca5fc 100644 --- a/Functions/Prompts/prompt_clint_setup +++ b/Functions/Prompts/prompt_clint_setup @@ -15,6 +15,8 @@ prompt_clint_setup () { local -A pc local p_date p_tty p_plat p_ver p_userpwd p_apm p_shlvlhist p_rc p_end p_win + autoload -Uz vcs_info + pcc[1]=${1:-'red'} pcc[2]=${2:-'cyan'} pcc[3]=${3:-'green'} @@ -36,7 +38,7 @@ prompt_clint_setup () { [[ -n "$WINDOW" ]] && p_win="$pc['\(']%F{$pcc[4]}$WINDOW$pc['\)']" p_userpwd="$pc['<']%F{$pcc[3]}%n@%m$p_win%F{$pcc[5]}:%F{$pcc[4]}%~$pc['>']" - p_git="%(2v.-%U%2v%u-.)" + p_vcs="%(2v.%U%2v%u.)" p_shlvlhist="%fzsh%(2L./$SHLVL.) %B%h%b " p_rc="%(?..[%?%1v] )" @@ -46,7 +48,7 @@ prompt_clint_setup () { prompt="$p_date$p_tty$p_plat$p_ver $p_userpwd -$p_shlvlhist$p_rc$p_git$p_end" +$p_shlvlhist$p_rc$p_vcs$p_end" PS2='%(4_.\.)%3_> %E' add-zsh-hook precmd prompt_clint_precmd @@ -63,9 +65,8 @@ prompt_clint_precmd () { [[ -o interactive ]] && jobs -l - git_dir=$(git-rev-parse --git-dir 2> /dev/null) || return - git_ref=$(git-symbolic-ref HEAD 2> /dev/null) || git_ref="(no branch)" - psvar[2]=${git_ref#refs/heads/} + vcs_info + [[ -n $vcs_info_msg_0_ ]] && psvar[2]="$vcs_info_msg_0_" } prompt_clint_setup "$@" |