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,30 +1,71 @@
|
|||
#!/usr/bin/env zsh
|
||||
#local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
||||
local R="%{$terminfo[sgr0]%}"
|
||||
#local return_code="%(?..%{$fg[red]%}%? ↵$R)"
|
||||
|
||||
setopt promptsubst
|
||||
|
||||
autoload -U add-zsh-hook
|
||||
|
||||
PROMPT_SUCCESS_COLOR=$FG[117]
|
||||
PROMPT_FAILURE_COLOR=$FG[124]
|
||||
PROMPT_VCS_INFO_COLOR=$FG[242]
|
||||
PROMPT_PROMPT=$FG[077]
|
||||
GIT_DIRTY_COLOR=$FG[133]
|
||||
GIT_CLEAN_COLOR=$FG[118]
|
||||
GIT_PROMPT_INFO=$FG[012]
|
||||
GIT_PROMPT_DEFAULT=$FG[012]
|
||||
|
||||
PROMPT='%{$PROMPT_SUCCESS_COLOR%}%~%{$reset_color%} %{$GIT_PROMPT_INFO%}$(git_prompt_info)%{$GIT_DIRTY_COLOR%}$(git_prompt_status) %{$reset_color%}%{$PROMPT_PROMPT%}ᐅ%{$reset_color%} '
|
||||
PROMPT='%{$FG[117]%}%~ $GIT_PROMPT_INFO $R%{$PROMPT_PROMPT%}ᐅ$R '
|
||||
|
||||
#RPS1="${return_code}"
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="("
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$GIT_PROMPT_INFO%})"
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$GIT_DIRTY_COLOR%}✘"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN=" %{$GIT_CLEAN_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[082]%}✚%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$FG[166]%}✹%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_DELETED="%{$FG[160]%}✖%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_RENAMED="%{$FG[220]%}➜%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$FG[082]%}═%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$FG[190]%}✭%{$reset_color%}"
|
||||
local branch=''
|
||||
|
||||
git_prompt__branch
|
||||
branch="$GIT_PROMPT_BRANCH"
|
||||
|
||||
git_prompt__rebase_info
|
||||
branch="${branch}$GIT_PROMPT_REBASE_INFO"
|
||||
|
||||
local dirty=''
|
||||
git_prompt__dirty_state
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_ANY_DIRTY" = 'yes' ]]; then
|
||||
dirty=" %{$GIT_DIRTY_COLOR%}✘"
|
||||
else
|
||||
dirty=" %{$GIT_CLEAN_COLOR%}✔"
|
||||
fi
|
||||
|
||||
local prompt="($R%{${branch}${dirty}%{$FG[012]%})"
|
||||
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_ADDED" = 'yes' ]]; then
|
||||
prompt="${prompt}%{$FG[082]%}✚"
|
||||
fi
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_MODIFIED" = 'yes' ]]; then
|
||||
prompt="${prompt}%{$FG[166]%}✹"
|
||||
fi
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_MODIFIED" = 'yes' ]]; then
|
||||
prompt="${prompt}%{$FG[166]%}✹"
|
||||
fi
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_DELETED" = 'yes' ]]; then
|
||||
prompt="${prompt}%{$FG[160]%}✖"
|
||||
fi
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_DELETED" = 'yes' ]]; then
|
||||
prompt="${prompt}%{$FG[160]%}✖"
|
||||
fi
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_RENAMED" = 'yes' ]]; then
|
||||
prompt="${prompt}%{$FG[220]%}➜"
|
||||
fi
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_UNMERGED" = 'yes' ]]; then
|
||||
prompt="${prompt}%{$FG[082]%}═"
|
||||
fi
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED" = 'yes' ]]; then
|
||||
prompt="${prompt}%{$FG[90]%}✭"
|
||||
fi
|
||||
GIT_PROMPT_INFO="$prompt$R"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue