mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-06 02:51:32 +01:00
refactor(pygmalion): redo and simplify prompt sequences
With this commit we put the minimal needed color resets, i.e. only
when we don't control the previous text we need to do a full reset.
Otherwise we can just use %F{} to change only the foreground color.
This commit is contained in:
parent
c4ffca6c00
commit
7d7d9f05f3
1 changed files with 8 additions and 12 deletions
|
|
@ -1,16 +1,12 @@
|
|||
# Yay! High voltage and arrows!
|
||||
|
||||
prompt_setup_pygmalion(){
|
||||
setopt localoptions nopromptsubst extendedglob
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{${reset_color}%}%F{green}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{${reset_color}%} "
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%F{yellow}⚡%f"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||
base_prompt="%{${reset_color}%}%F{magenta}%n%F{cyan}@%F{yellow}%m%F{red}:%F{cyan}%0~%F{red}|%f"
|
||||
post_prompt="%{${reset_color}%}%F{cyan}⇒%f "
|
||||
|
||||
base_prompt='%{$fg[magenta]%}%n%{$reset_color%}%{$fg[cyan]%}@%{$reset_color%}%{$fg[yellow]%}%m%{$reset_color%}%{$fg[red]%}:%{$reset_color%}%{$fg[cyan]%}%0~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}'
|
||||
post_prompt='%{$fg[cyan]%}⇒%{$reset_color%} '
|
||||
PROMPT="${base_prompt}\$(git_prompt_info)${post_prompt}"
|
||||
}
|
||||
|
||||
prompt_setup_pygmalion
|
||||
PROMPT="${base_prompt}\$(git_prompt_info)${post_prompt}"
|
||||
unset base_prompt post_prompt
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue