From 9b19b5b9a1aae828101c901eee39491765ea4603 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sun, 31 May 2009 23:40:48 +0000 Subject: Work on vcsinfo git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@397 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- zshrc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'zshrc') diff --git a/zshrc b/zshrc index ca56e5e..03e9fc3 100644 --- a/zshrc +++ b/zshrc @@ -273,6 +273,9 @@ case $TERM in function build-and-update-title() { } fi ;; + *) + function build-and-update-title() { } + ;; esac function precmd() { @@ -294,13 +297,13 @@ 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='%{$terminfo[bold]$fg[${(L)color}]%}' - eval PR_LIGHT_$color='%{$fg[${(L)color}]%}' + eval PR_$color='%{$fg[${(L)color}]%}' (( count = $count + 1 )) done @@ -308,6 +311,7 @@ function init-prompt() { 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 @@ -315,16 +319,16 @@ function init-prompt() { zstyle ':vcs_info:*' formats "(%s%)-[%b] " else # these are the same, just with a lot of colours: - zstyle ':vcs_info:*' actionformats "${PR_YELLOW}(${PR_NO_COLOUR}%s${PR_YELLOW})${PR_CYAN}-${PR_YELLOW}[${PR_GREEN}%b${PR_YELLOW}|${PR_RED}%a${PR_YELLOW}]${PR_NO_COLOUR}" - zstyle ':vcs_info:*' formats "${PR_YELLOW}(${PR_NO_COLOUR}%s${PR_YELLOW})${PR_CYAN}-${PR_YELLOW}[${PR_GREEN}%b${PR_YELLOW}]${PR_NO_COLOUR}" + zstyle ':vcs_info:*' actionformats "${PR_YELLOW}[${PR_CYAN}%s${PR_YELLOW}|${PR_GREEN}%b${PR_YELLOW}|${PR_RED}%a${PR_YELLOW}]${PR_NO_COLOUR} " + zstyle ':vcs_info:*' formats "${PR_YELLOW}[${PR_CYAN}%s${PR_YELLOW}|${PR_GREEN}%b${PR_YELLOW}]${PR_NO_COLOUR} " zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat "%b${PR_RED}:${YELLOW}%r" fi if [ "`id -u`" = "0" -o ! -x /usr/bin/id ] ; then - export PROMPT="${debian_chroot:+[$debian_chroot] }%n@%m${vcs_info_msg_0_}:%~# " + export PROMPT='${debian_chroot:+[$debian_chroot] }${vcs_info_msg_0_}%n@%m:%~# ' export TITLE="%n@%m: %~" else - export PROMPT="${debian_chroot:+[$debian_chroot] }%n@%m${vcs_info_msg_0_}:%~$ " + export PROMPT='${debian_chroot:+[$debian_chroot] }${vcs_info_msg_0_}%n@%m:%~$ ' export TITLE="%n@%m: %~" fi } -- cgit v1.2.3