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
|
|
@ -3,17 +3,28 @@ if [[ -s ~/.rvm/scripts/rvm ]] ; then
|
|||
RPS1="%{$fg[yellow]%}rvm:%{$reset_color%}%{$fg[red]%}\$(~/.rvm/bin/rvm-prompt)%{$reset_color%} $EPS1"
|
||||
fi
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}["
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}*%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||
local R="%{$terminfo[sgr0]%}"
|
||||
|
||||
#Customized git status, oh-my-zsh currently does not allow render dirty status before branch
|
||||
git_custom_status() {
|
||||
local cb=$(current_branch)
|
||||
if [ -n "$cb" ]; then
|
||||
echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
||||
fi
|
||||
git_prompt_info ()
|
||||
{
|
||||
if [ -z "$(git_prompt__git_dir)" ]; then
|
||||
GIT_PROMPT_INFO=''
|
||||
return
|
||||
fi
|
||||
|
||||
git_prompt__branch
|
||||
local cb=$GIT_PROMPT_BRANCH
|
||||
|
||||
git_prompt__rebase_info
|
||||
cb="${cb}$GIT_PROMPT_REBASE_INFO"
|
||||
|
||||
local dirty
|
||||
git_prompt__dirty_state
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_ANY_DIRTY" = 'yes' ]]; then
|
||||
dirty="%{$fg[red]%}*%{$reset_color%}"
|
||||
fi
|
||||
|
||||
GIT_PROMPT_INFO="$dirty$R%{$fg[green]%}[$cb]$R"
|
||||
}
|
||||
|
||||
PROMPT='$(git_custom_status)%{$fg[cyan]%}[%~% ]%{$reset_color%}%B$%b '
|
||||
PROMPT='$GIT_PROMPT_INFO%{$fg[cyan]%}[%~% ]%{$reset_color%}%B$%b '
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue