mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Change all the themes to use the new git plugin and rm the old git plugin code.
This commit is contained in:
parent
c661eedfb1
commit
723c2c43c8
71 changed files with 672 additions and 392 deletions
|
|
@ -1,15 +1,51 @@
|
|||
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
|
||||
local R="%{$terminfo[sgr0]%}"
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="("
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX=")"
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY=""
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$GIT_PROMPT_INFO % $R'
|
||||
RPROMPT='$GIT_RPROMPT_INFO$R'
|
||||
|
||||
RPROMPT='$(git_prompt_status)%{$reset_color%}'
|
||||
git_prompt_info ()
|
||||
{
|
||||
if [ -z "$(git_prompt__git_dir)" ]; then
|
||||
GIT_PROMPT_INFO=''
|
||||
GIT_RPROMPT_INFO=''
|
||||
return
|
||||
fi
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%} ✈"
|
||||
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ✭"
|
||||
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✗"
|
||||
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%} ➦"
|
||||
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[magenta]%} ✂"
|
||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[grey]%} ✱"
|
||||
local prompt=''
|
||||
|
||||
git_prompt__branch
|
||||
prompt="$GIT_PROMPT_BRANCH"
|
||||
|
||||
git_prompt__rebase_info
|
||||
prompt="${prompt}$GIT_PROMPT_REBASE_INFO"
|
||||
|
||||
GIT_PROMPT_INFO="($prompt)"
|
||||
|
||||
local rprompt=''
|
||||
git_prompt__dirty_state
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_ADDED" = 'yes' ]]; then
|
||||
rprompt="%{$fg[cyan]%} ✈"
|
||||
fi
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_MODIFIED" = 'yes' ]]; then
|
||||
rprompt="${rprompt}%{$fg[yellow]%} ✭"
|
||||
fi
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_MODIFIED" = 'yes' ]]; then
|
||||
rprompt="${rprompt}%{$fg[yellow]%} ✭"
|
||||
fi
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_DELETED" = 'yes' ]]; then
|
||||
rprompt="${rprompt}%{$fg[red]%} ✗"
|
||||
fi
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_DELETED" = 'yes' ]]; then
|
||||
rprompt="${rprompt}%{$fg[red]%} ✗"
|
||||
fi
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_RENAMED" = 'yes' ]]; then
|
||||
rprompt="${rprompt}%{$fg[blue]%} ➦"
|
||||
fi
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_UNMERGED" = 'yes' ]]; then
|
||||
rprompt="${rprompt}%{$fg[magenta]%} ✂"
|
||||
fi
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED" = 'yes' ]]; then
|
||||
rprompt="${rprompt}%{$fg[grey]%} ✱"
|
||||
fi
|
||||
GIT_RPROMPT_INFO=$rprompt
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue