diff options
author | Peter Palfrader <peter@palfrader.org> | 2013-04-21 19:46:51 +0000 |
---|---|---|
committer | weasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede> | 2013-04-21 19:46:51 +0000 |
commit | 239f684d2652db805833bcda5fe8ef8b6f5597e8 (patch) | |
tree | e17670828949938c5d91b42d879a7430bf081f77 /zshrc | |
parent | 86301e3198d34a706bfa16cbae5977b926269537 (diff) |
Move colorstuff out of init-prompt
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@619 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
Diffstat (limited to 'zshrc')
-rw-r--r-- | zshrc | 27 |
1 files changed, 14 insertions, 13 deletions
@@ -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] " |