mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-09 02:24:03 +01:00
Added better GIT-info
This commit is contained in:
parent
2aab54135c
commit
2eb006d435
1 changed files with 19 additions and 4 deletions
|
|
@ -1,7 +1,22 @@
|
||||||
PROMPT='%n%{$reset_color%}%{$fg[red]%}@%m%{$reset_color%}:[%{$fg[green]%}%~%{$reset_color%}]$(git_prompt_info)%{$fg[red]%} ➜ %{$reset_color%}'
|
function git_prompt_custom() {
|
||||||
|
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
|
||||||
|
GIT_STATUS="%{$fg[red]%}<%{$reset_color%}$(git_prompt_info)%{$reset_color%}[%{$fg[green]%}$(git_prompt_short_sha)%{$reset_color%}]$(git_prompt_status)%{$fg[red]%}>"
|
||||||
|
[[ -n $GIT_STATUS ]] && GIT_STATUS=" $GIT_STATUS"
|
||||||
|
echo "$ZSH_THEME_GIT_PROMPT_PREFIX$GIT_STATUS$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
||||||
|
}
|
||||||
|
|
||||||
|
PROMPT='%n%{$reset_color%}%{$fg[red]%}@%m%{$reset_color%}:[%{$fg[green]%}%~%{$reset_color%}]%u$(git_prompt_custom)%{$fg[red]%} ?^?^? %{$reset_color%}'
|
||||||
RPROMPT='[%{$fg[red]%}%W %t%{$reset_color%}]'
|
RPROMPT='[%{$fg[red]%}%W %t%{$reset_color%}]'
|
||||||
|
|
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%} <"
|
ZSH_THEME_GIT_PROMPT_PREFIX=""
|
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||||
ZSH_THEME_GIT_PROMPT_DIRTY=":%{$fg[white]%}✗%{$fg[red]%}>%{$reset_color%}"
|
ZSH_THEME_GIT_PROMPT_DIRTY=": %{$fg[red]%}?^?^?%{$fg[red]%} "
|
||||||
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[red]%}>"
|
ZSH_THEME_GIT_PROMPT_CLEAN=": %{$fg[red]%}"
|
||||||
|
|
||||||
|
ZSH_THEME_GIT_PROMPT_UNMERGED=" %{$RED%}unmerged"
|
||||||
|
ZSH_THEME_GIT_PROMPT_DELETED=" %{$RED%}deleted"
|
||||||
|
ZSH_THEME_GIT_PROMPT_RENAMED=" %{$YELLOW%}renamed"
|
||||||
|
ZSH_THEME_GIT_PROMPT_MODIFIED=" %{$YELLOW%}modified"
|
||||||
|
ZSH_THEME_GIT_PROMPT_ADDED=" %{$GREEN%}added"
|
||||||
|
ZSH_THEME_GIT_PROMPT_UNTRACKED=" %{$WHITE%}untracked"
|
||||||
|
ZSH_THEME_GIT_PROMPT_AHEAD=" %{$RED%}(!)"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue