about summary refs log tree commit diff
path: root/Functions/Prompts/prompt_clint_setup
diff options
context:
space:
mode:
Diffstat (limited to 'Functions/Prompts/prompt_clint_setup')
-rw-r--r--Functions/Prompts/prompt_clint_setup34
1 files changed, 16 insertions, 18 deletions
diff --git a/Functions/Prompts/prompt_clint_setup b/Functions/Prompts/prompt_clint_setup
index a9960a016..154edede1 100644
--- a/Functions/Prompts/prompt_clint_setup
+++ b/Functions/Prompts/prompt_clint_setup
@@ -21,36 +21,35 @@ prompt_clint_setup () {
   pcc[4]=${4:-'yellow'}
   pcc[5]=${5:-'white'}
 
-  pc['\[']="%{$fg_no_bold[$pcc[1]]%}["
-  pc['\]']="%{$fg_no_bold[$pcc[1]]%}]"
-  pc['<']="%{$fg_no_bold[$pcc[1]]%}<"
-  pc['>']="%{$fg_no_bold[$pcc[1]]%}>"
-  pc['\(']="%{$fg_no_bold[$pcc[1]]%}("
-  pc['\)']="%{$fg_no_bold[$pcc[1]]%})"
+  pc['\[']="%F{$pcc[1]}["
+  pc['\]']="%F{$pcc[1]}]"
+  pc['<']="%F{$pcc[1]}<"
+  pc['>']="%F{$pcc[1]}>"
+  pc['\(']="%F{$pcc[1]}("
+  pc['\)']="%F{$pcc[1]})"
 
-  p_date="$pc['\[']%{$fg_no_bold[$pcc[2]]%}%D{%a %y/%m/%d %R %Z}$pc['\]']"
-  p_tty="$pc['\[']%{$fg_no_bold[$pcc[3]]%}%l$pc['\]']"
-  p_plat="$pc['\[']%{$fg_no_bold[$pcc[2]]%}${MACHTYPE}/${OSTYPE}/$(uname -r)$pc['\]']"
-  p_ver="$pc['\[']%{$fg_no_bold[$pcc[2]]%}${ZSH_VERSION}$pc['\]']"
+  p_date="$pc['\[']%F{$pcc[2]}%D{%a %y/%m/%d %R %Z}$pc['\]']"
+  p_tty="$pc['\[']%F{$pcc[3]}%l$pc['\]']"
+  p_plat="$pc['\[']%F{$pcc[2]}${MACHTYPE}/${OSTYPE}/$(uname -r)$pc['\]']"
+  p_ver="$pc['\[']%F{$pcc[2]}${ZSH_VERSION}$pc['\]']"
 
-  [[ -n "$WINDOW" ]] && p_win="$pc['\(']%{$fg_bold[$pcc[4]]%}$WINDOW$pc['\)']"
+  [[ -n "$WINDOW" ]] && p_win="$pc['\(']%F{$pcc[4]}$WINDOW$pc['\)']"
 
-  p_userpwd="$pc['<']%{$fg_no_bold[$pcc[3]]%}%n@%m$p_win%{$fg_bold[$pcc[5]]%}:%{$fg_no_bold[$pcc[4]]%}%~$pc['>']"
+  p_userpwd="$pc['<']%F{$pcc[3]}%n@%m$p_win%F{$pcc[5]}:%F{$pcc[4]}%~$pc['>']"
   p_git="%(2v.-%U%2v%u-.)"
 
-  p_shlvlhist="%{$reset_color%}zsh%(2L./$SHLVL.) %B%h%b "
+  p_shlvlhist="%fzsh%(2L./$SHLVL.) %B%h%b "
   p_rc="%(?..[%?%1v] )"
-  p_end="%{$reset_color%}%B%#%b %{$fg_no_bold[$pcc[2]]%}"
+  p_end="%f%B%#%b "
 
-  POSTEDIT="$reset_color"
+  zle_highlight[(r)default:*]=default:$pcc[2]
 
   prompt="$p_date$p_tty$p_plat$p_ver
 $p_userpwd
 $p_shlvlhist$p_rc$p_git$p_end"
   PS2='%(4_.\.)%3_> %E'
 
-  precmd () { prompt_clint_precmd }
-  preexec () { }
+  add-zsh-hook precmd prompt_clint_precmd
 }
 
 prompt_clint_precmd () {
@@ -67,7 +66,6 @@ prompt_clint_precmd () {
   git_dir=$(git-rev-parse --git-dir 2> /dev/null) || return
   git_ref=$(git-symbolic-ref HEAD 2> /dev/null) || git_ref="(no branch)"
   psvar[2]=${git_ref#refs/heads/}
-
 }
 
 prompt_clint_setup "$@"