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
|
|
@ -2,47 +2,72 @@
|
|||
# FILE: sorin.zsh-theme
|
||||
# DESCRIPTION: oh-my-zsh theme file.
|
||||
# AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com)
|
||||
# VERSION: 1.0.3
|
||||
# VERSION: 1.0.4
|
||||
# SCREENSHOT: http://i.imgur.com/aipDQ.png
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
if [[ "$DISABLE_COLOR" != "true" ]]; then
|
||||
MODE_INDICATOR="%{$fg_bold[red]%}❮%{$reset_color%}%{$fg[red]%}❮❮%{$reset_color%}"
|
||||
local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}"
|
||||
|
||||
PROMPT='%{$fg[cyan]%}%c$(git_prompt_info) %(!.%{$fg_bold[red]%}#.%{$fg_bold[green]%}❯)%{$reset_color%} '
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[blue]%}git%{$reset_color%}:%{$fg[red]%}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY=""
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||
|
||||
RPROMPT='${return_status}$(git_prompt_status)%{$reset_color%}'
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚"
|
||||
ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹"
|
||||
ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖"
|
||||
ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜"
|
||||
ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═"
|
||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭"
|
||||
else
|
||||
MODE_INDICATOR="❮❮❮"
|
||||
local return_status="%(?::⏎)"
|
||||
|
||||
PROMPT='%c$(git_prompt_info) %(!.#.❯) '
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX=" git:"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX=""
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY=""
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||
|
||||
RPROMPT='${return_status}$(git_prompt_status)'
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_ADDED=" ✚"
|
||||
ZSH_THEME_GIT_PROMPT_MODIFIED=" ✹"
|
||||
ZSH_THEME_GIT_PROMPT_DELETED=" ✖"
|
||||
ZSH_THEME_GIT_PROMPT_RENAMED=" ➜"
|
||||
ZSH_THEME_GIT_PROMPT_UNMERGED=" ═"
|
||||
ZSH_THEME_GIT_PROMPT_UNTRACKED=" ✭"
|
||||
if [[ "$DISABLE_COLORS" != "true" ]]; then
|
||||
local R="%{$terminfo[sgr0]%}"
|
||||
local MAGENTA="%{$fg[magenta]%}"
|
||||
local YELLOW="%{$fg[yellow]%}"
|
||||
local GREEN="%{$fg[green]%}"
|
||||
local B_GREEN="%{$fg_bold[green]%}"
|
||||
local BLUE="%{$fg[blue]%}"
|
||||
local CYAN="%{$fg[cyan]%}"
|
||||
local RED="%{$fg[red]%}"
|
||||
local B_RED="%{$fg_bold[red]%}"
|
||||
fi
|
||||
|
||||
MODE_INDICATOR="$B_RED❮$R$RED❮❮$R"
|
||||
local return_status="$RED%(?..⏎)$R"
|
||||
|
||||
PROMPT='$CYAN%c$GIT_PROMPT_INFO %(!.$B_RED#.$B_GREEN❯)$R '
|
||||
RPROMPT='${return_status}$GIT_RPROMPT_INFO$R'
|
||||
|
||||
git_prompt_info ()
|
||||
{
|
||||
if [ -z "$(git_prompt__git_dir)" ]; then
|
||||
GIT_PROMPT_INFO=''
|
||||
GIT_RPROMPT_INFO=''
|
||||
return
|
||||
fi
|
||||
|
||||
local branch=''
|
||||
|
||||
git_prompt__branch
|
||||
branch="$GIT_PROMPT_BRANCH"
|
||||
|
||||
git_prompt__rebase_info
|
||||
branch="${branch}$GIT_PROMPT_REBASE_INFO"
|
||||
|
||||
GIT_PROMPT_INFO=" ${BLUE}git$R:$RED${branch}$R"
|
||||
|
||||
local rprompt=''
|
||||
git_prompt__dirty_state
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_ADDED" = 'yes' ]]; then
|
||||
rprompt="$GREEN ✚"
|
||||
fi
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_MODIFIED" = 'yes' ]]; then
|
||||
rprompt="${rprompt}$BLUE ✹"
|
||||
fi
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_MODIFIED" = 'yes' ]]; then
|
||||
rprompt="${rprompt}$BLUE ✹"
|
||||
fi
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_DELETED" = 'yes' ]]; then
|
||||
rprompt="${rprompt}$RED ✖"
|
||||
fi
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_DELETED" = 'yes' ]]; then
|
||||
rprompt="${rprompt}$RED ✖"
|
||||
fi
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_RENAMED" = 'yes' ]]; then
|
||||
rprompt="${rprompt}$MAGENTA ➜"
|
||||
fi
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_INDEX_UNMERGED" = 'yes' ]]; then
|
||||
rprompt="${rprompt}$YELLOW ═"
|
||||
fi
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED" = 'yes' ]]; then
|
||||
rprompt="${rprompt}$CYAN ✭"
|
||||
fi
|
||||
GIT_RPROMPT_INFO=$rprompt
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue