]> src.twobees.de Git - dotfiles.git/blob - stow/oh-my-zsh/.oh-my-zsh/themes/pygmalion.zsh-theme
...
[dotfiles.git] / stow / oh-my-zsh / .oh-my-zsh / themes / pygmalion.zsh-theme
1 # Yay! High voltage and arrows!
2
3 prompt_setup_pygmalion(){
4   setopt localoptions extendedglob
5
6   ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}"
7   ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
8   ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}"
9   ZSH_THEME_GIT_PROMPT_CLEAN=""
10
11   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%}'
12   post_prompt='%{$fg[cyan]%}⇒%{$reset_color%}  '
13
14   base_prompt_nocolor=${base_prompt//\%\{[^\}]##\}}
15   post_prompt_nocolor=${post_prompt//\%\{[^\}]##\}}
16
17   autoload -U add-zsh-hook
18   add-zsh-hook precmd prompt_pygmalion_precmd
19 }
20
21 prompt_pygmalion_precmd(){
22   setopt localoptions nopromptsubst extendedglob
23
24   local gitinfo=$(git_prompt_info)
25   local gitinfo_nocolor=${gitinfo//\%\{[^\}]##\}}
26   local exp_nocolor="$(print -P \"${base_prompt_nocolor}${gitinfo_nocolor}${post_prompt_nocolor}\")"
27   local prompt_length=${#exp_nocolor}
28
29   PROMPT="${base_prompt}\$(git_prompt_info)${post_prompt}"
30 }
31
32 prompt_setup_pygmalion