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
|
|
@ -9,11 +9,32 @@ function virtualenv_info {
|
|||
}
|
||||
|
||||
PROMPT='
|
||||
%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(git_prompt_info)
|
||||
%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}%m%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$GIT_PROMPT_INFO
|
||||
$(virtualenv_info)$(prompt_char) '
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[green]%}!"
|
||||
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||
git_prompt_info ()
|
||||
{
|
||||
if [ -z "$(git_prompt__git_dir)" ]; then
|
||||
GIT_PROMPT_INFO=''
|
||||
return
|
||||
fi
|
||||
|
||||
local prompt=""
|
||||
git_prompt__branch
|
||||
prompt=$GIT_PROMPT_BRANCH
|
||||
|
||||
git_prompt__rebase_info
|
||||
prompt="${prompt}$GIT_PROMPT_REBASE_INFO"
|
||||
|
||||
if [[ -n "$prompt" ]]; then
|
||||
git_prompt__dirty_state
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_ANY_DIRTY" = 'yes' ]]; then
|
||||
prompt="$prompt%{$fg[green]%}!"
|
||||
fi
|
||||
if [[ "$GIT_PROMPT_DIRTY_STATE_WORKTREE_UNTRACKED" = 'yes' ]]; then
|
||||
prompt="$prompt%{$fg[green]%}?"
|
||||
fi
|
||||
|
||||
GIT_PROMPT_INFO=" on %{$fg[magenta]%}$prompt%{$reset_color%}"
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue