From 97d599e935ad56d81459b843c69faef9ee25491a Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 12 Jul 2009 17:40:57 +0200 Subject: rename and reorder colors --- .zshrc | 65 ++++++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/.zshrc b/.zshrc index 4eb4118..bec0aec 100644 --- a/.zshrc +++ b/.zshrc @@ -10,35 +10,42 @@ ZDOTDIR="$HOME/.zsh" # Colors {{{ #use these in functions/shell scripts +export NC='\e[0m' +export white='\e[0;30m' +export WHITE='\e[1;30m' export red='\e[0;31m' export RED='\e[1;31m' export green='\e[0;32m' export GREEN='\e[1;32m' +export yellow='\e[0;33m' +export YELLOW='\e[1;33m' export blue='\e[0;34m' export BLUE='\e[1;34m' -export purple='\e[0;35m' -export PURPLE='\e[1;35m' +export magenta='\e[0;35m' +export MAGENTA='\e[1;35m' export cyan='\e[0;36m' export CYAN='\e[1;36m' -export NC='\e[0m' +export black='\e[0;37m' +export BLACK='\e[1;37m' # 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%}' +p_nc=$'%{\e[0m%}' +p_white=$'%{\e[0;30m%}' +p_WHITE=$'%{\e[1;30m%}' +p_red=$'%{\e[0;31m%}' +p_RED=$'%{\e[1;31m%}' +p_green=$'%{\e[0;32m%}' +p_GREEN=$'%{\e[1;32m%}' +p_yellow=$'%{\e[0;33m%}' +p_YELLOW=$'%{\e[1;33m%}' +p_blue=$'%{\e[0;34m%}' +p_BLUE=$'%{\e[1;34m%}' +p_magenta=$'%{\e[0;35m%}' +p_MAGENTA=$'%{\e[1;35m%}' +p_cyan=$'%{\e[0;36m%}' +p_CYAN=$'%{\e[1;36m%}' +p_black=$'%{\e[0;37m%}' +p_white=$'%{\e[1;37m%}' # colors in framebuffer! if [ "$TERM" = "linux" ]; then @@ -107,17 +114,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=$p_blue else - local username_color=$fg_red + local username_color=$p_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=$p_GREEN +local path_color=$p_BLUE +local gitbranch_color=$p_magenta +local exitcode_color=$p_red +PROMPT="${username_color}$USERNAME${p_nc}@${host_color}%m${p_nc}\ +:${path_color}%~${p_nc} ${gitbranch_color}$(parse_git_branch)${p_nc} +${exitcode_color}$EXITCODE${p_nc}> " } ## Spelling prompt @@ -162,7 +169,7 @@ chpwd() { # idea by Gigamo http://bbs.archlinux.org/viewtopic.php?pid=478094#p478094 ls () { /bin/ls -rhbtF --color=auto $@ && - echo "${PURPLE}Files: ${BLUE}$(/bin/ls -l $@ | grep -v "^[l|d|total]" | wc -l) ${GREEN}--- ${PURPLE}Directories: ${BLUE}$(/bin/ls -l $@ | grep "^d" | wc -l)${NC}" + echo "${MAGENTA}Files: ${BLUE}$(/bin/ls -l $@ | grep -v "^[l|d|total]" | wc -l) ${GREEN}--- ${MAGENTA}Directories: ${BLUE}$(/bin/ls -l $@ | grep "^d" | wc -l)${NC}" } password() { -- cgit v1.2.3-24-g4f1b