daily pastebin goal
39%
SHARE
TWEET

Untitled

a guest Jan 19th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. prompt_setup_pygmalion(){
  2.   ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
  3.   ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
  4.   ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%})%{$fg[yellow]%}✗"
  5.   ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
  6.  
  7.   base_prompt='╒ %{$FG[046]%}% 【%{$fg_bold[cyan]%}% ⋉Ⓕ Ⓐ Ⓒ Ⓘ Ⓔ Ⓜ ⋊%{$FG[046]%}% 】%{$reset_color%}%{%{$FG[242]%}%}〘%{$FG[164]%}% ∴GreyTeam∴ %{$FG[164]%}% %{$FG[242]%}% 〙 %{$FG[160]%}% ╱%{$fg_bold[cyan]%}%0~%{$FG[160]%}% ╲%{$reset_color%}'
  8.   post_prompt='╘ %{$FG[220]%}➤ %{$reset_color%}%{$fg_bold[red]%}  %{$reset_color%} '
  9.  
  10.   base_prompt_nocolor=$(echo "$base_prompt" | perl -pe "s/%\{[^}]+\}//g")
  11.   post_prompt_nocolor=$(echo "$post_prompt" | perl -pe "s/%\{[^}]+\}//g")
  12.  
  13.   precmd_functions+=(prompt_pygmalion_precmd)
  14. }
  15.  
  16. prompt_pygmalion_precmd(){
  17.   local gitinfo=$(git_prompt_info)
  18.   local gitinfo_nocolor=$(echo "$gitinfo" | perl -pe "s/%\{[^}]+\}//g")
  19.   local exp_nocolor="$(print -P \"$base_prompt_nocolor$gitinfo_nocolor$post_prompt_nocolor\")"
  20.   local prompt_length=${#exp_nocolor}
  21.  
  22.   local nl=""
  23.  
  24.   if [[ $prompt_length -gt 40 ]]; then
  25.     nl=$'\n%{\r%}';
  26.   fi
  27.   PROMPT="$base_prompt$gitinfo$nl$post_prompt"
  28. }
  29.  
  30. prompt_setup_pygmalion
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top