From 6aa8407f946977bec7fd5f4050ae4e7f92a4286c Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 12 Jul 2009 16:35:22 +0200 Subject: use zsh builtin color variables --- .zshrc | 36 +++++++++--------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) (limited to '.zshrc') diff --git a/.zshrc b/.zshrc index 4eb4118..e509c3e 100644 --- a/.zshrc +++ b/.zshrc @@ -22,24 +22,6 @@ export cyan='\e[0;36m' export CYAN='\e[1;36m' export NC='\e[0m' -# these are for use in PROMPT -fg_green=$'%{\e[0;32m%}' -fg_blue=$'%{\e[0;34m%}' -fg_cyan=$'%{\e[0;36m%}' -fg_red=$'%{\e[0;31m%}' -fg_brown=$'%{\e[0;33m%}' -fg_purple=$'%{\e[0;35m%}' -fg_light_gray=$'%{\e[0;37m%}' -fg_dark_gray=$'%{\e[1;30m%}' -fg_light_blue=$'%{\e[1;34m%}' -fg_light_green=$'%{\e[1;32m%}' -fg_light_cyan=$'%{\e[1;36m%}' -fg_light_red=$'%{\e[1;31m%}' -fg_light_purple=$'%{\e[1;35m%}' -fg_no_colour=$'%{\e[0m%}' -fg_white=$'%{\e[1;37m%}' -fg_black=$'%{\e[0;30m%}' - # colors in framebuffer! if [ "$TERM" = "linux" ]; then ${HOME}/bin/parse_xdefaults.sh @@ -107,17 +89,17 @@ precmd () { # this has to be on the edge or you have some spaces in the prompt # if you have any workaround please tell if [[ $UID != 0 ]]; then - local username_color=$fg_blue + local username_color=$fg[blue] else - local username_color=$fg_red + local username_color=$fg[red] fi -local host_color=$fg_light_green -local path_color=$fg_light_blue -local gitbranch_color=$fg_purple -local exitcode_color=$fg_red -PROMPT="${username_color}$USERNAME${fg_no_colour}@${host_color}%m${fg_no_colour}\ -:${path_color}%~${fg_no_colour} ${gitbranch_color}$(parse_git_branch)${fg_no_colour} -${exitcode_color}$EXITCODE${fg_no_colour}> " +local host_color=$fg_bold[green] +local path_color=$fg_bold[blue] +local gitbranch_color=$fg[magenta] +local exitcode_color=$fg[red] +PROMPT="${username_color}$USERNAME${fg[default]}@${host_color}%m${fg[default]}\ +:${path_color}%~${fg[default]} ${gitbranch_color}$(parse_git_branch)${fg[default]} +${exitcode_color}$EXITCODE${fg[default]}> " } ## Spelling prompt -- cgit v1.2.3-24-g4f1b