From 239f684d2652db805833bcda5fe8ef8b6f5597e8 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sun, 21 Apr 2013 19:46:51 +0000 Subject: Move colorstuff out of init-prompt git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@619 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- zshrc | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'zshrc') diff --git a/zshrc b/zshrc index 09b2f2c..3288fb7 100644 --- a/zshrc +++ b/zshrc @@ -79,6 +79,20 @@ setopt \ HIST_FIND_NO_DUPS \ HIST_IGNORE_SPACE \ +# init colors: +setopt PROMPTSUBST +autoload colors zsh/terminfo +if [[ "$terminfo[colors]" -ge 8 ]]; then + colors +fi +for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do + eval PR_$color='%{$fg[${(L)color}]%}' + (( count = $count + 1 )) +done +PR_BOLD="%{$terminfo[bold]%}" +PR_NO_COLOUR="%{$terminfo[sgr0]%}" + + # in 'foo bar | baz' make a second ^W not eat 'bar |', but only '|' # this has the disadvantage that in 'bar|baz' it eats all of it. typeset WORDCHARS='|'$WORDCHARS @@ -324,23 +338,10 @@ zstyle ':vcs_info:*' use_simple function init-prompt() { - # init colors: - setopt PROMPTSUBST - autoload colors zsh/terminfo - if [[ "$terminfo[colors]" -ge 8 ]]; then - colors - fi - for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do - eval PR_$color='%{$fg[${(L)color}]%}' - (( count = $count + 1 )) - done - if [ -e /etc/debian_chroot ]; then debian_chroot=$(cat /etc/debian_chroot) fi - PR_BOLD="%{$terminfo[bold]%}" - PR_NO_COLOUR="%{$terminfo[sgr0]%}" # change vcs_info formats for the prompt if [[ "$TERM" == dumb ]] ; then zstyle ':vcs_info:*' actionformats "(%s%)-[%b|%a] " -- cgit v1.2.3