mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-20 03:13:33 +01:00
update v2: a different icon displays if in a local git directory
This commit is contained in:
parent
75c52548f6
commit
a2e069c1a4
1 changed files with 7 additions and 2 deletions
|
|
@ -42,15 +42,20 @@ function git_prompt_info() {
|
|||
echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIXS"
|
||||
}
|
||||
|
||||
function prompt_char {
|
||||
git branch >/dev/null 2>/dev/null && echo '○' && return
|
||||
echo '>'
|
||||
}
|
||||
|
||||
# ########## PROMPT VARIABLE ###########
|
||||
|
||||
PROMPT='
|
||||
%{$fg[green]%}$(get_pwd)%{$reset_color%} 🕕 %{$fg[green]%}%*%{$reset_color%}$(put_spacing)$(git_prompt_info)
|
||||
> '
|
||||
$(prompt_char) '
|
||||
|
||||
# ########## ZSH GIT THEME VARIABLES ###########
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="git:"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="$reset_color"
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="$fg[red]✹"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN="$fg[white]"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN="$fg[white]"
|
||||
Loading…
Add table
Add a link
Reference in a new issue