From 2d4b8e1fdef628e78512d806337e8ef3ac7e63da Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Fri, 15 Mar 2013 10:35:38 +0100 Subject: [PATCH] update zshrc --- dotfiles/shell/zshrc | 48 ++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/dotfiles/shell/zshrc b/dotfiles/shell/zshrc index cc00a53..f339849 100644 --- a/dotfiles/shell/zshrc +++ b/dotfiles/shell/zshrc @@ -7,14 +7,11 @@ bindkey -e zstyle :compinstall filename "$HOME/.zshrc" -autoload -Uz compinit -compinit -if [ -e $HOME/.bash_completion ]; then - autoload bashcompinit - bashcompinit - source $HOME/.bash_completion -fi +autoload -U compinit promptinit +compinit +promptinit; prompt gentoo +zstyle ':completion::complete:*' use-cache 1 autoload colors zsh/terminfo if [[ "$terminfo[colors]" -ge 8 ]]; then @@ -25,11 +22,10 @@ eval `dircolors` LS_COLORS="${LS_COLORS}*.divx=01;35:" zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} -TERM=xterm-256color - zstyle ':completion:*' menu select zmodload -i zsh/complist +#TERM=xterm-256color # bind special keys according to readline configuration @@ -83,7 +79,7 @@ HISTFILE=~/.zsh_history HISTSIZE=50000 SAVEHIST=50000 REPORTTIME=5 -TIMEFMT="$terminfo[bold]$fg[yellow]%J %U user %S sys %P cpu %*E total %M kB max$terminfo[sgr0]" +TIMEFMT="$fg[magenta]%J %U user %S sys %P cpu %*E total %M kB max$terminfo[sgr0]" autoload -Uz vcs_info && vcs_info zstyle ':vcs_info:*' enable git cvs svn hg @@ -94,34 +90,42 @@ zstyle ':vcs_info:*' max-exports 1 function setprompt() { # default: " (%s)-[%b|%a]%u%c-" - zstyle ':vcs_info:*' actionformats "${PR_YELLOW}%s:%b|%a${PR_NO_COLOUR}" + zstyle ':vcs_info:*' actionformats " %s: %b|%a" # default: " (%s)-[%b]%u%c-" - zstyle ':vcs_info:*' formats "${PR_YELLOW}%s:%b${PR_NO_COLOUR}" + zstyle ':vcs_info:*' formats " %s: %b" setopt PROMPT_SUBST - PROMPT='%(!.$PR_RED.$PR_GREEN)%n@%m $PR_BLUE%1~ %# $PR_NO_COLOUR' - RPROMPT='${vcs_info_msg_0_}${PR_STUFF}' + PROMPT=' +%(!.%{$fg_bold[red]%}.%{$fg_bold[green]%})%n@%m%{$reset_color%}$PR_SCREEN$PR_JOBS%{$fg_bold[yellow]%}${vcs_info_msg_0_}%{$reset_color%} %{$fg_bold[blue]%}%~%{$reset_color%} +$PR_EXIT%# ' } setprompt # Obtain the autofs mountpoints autofs_mp="" -[ -r /etc/auto.master ] && autofs_mp=$(grep -e "^/" /etc/auto.master) +[ -r /etc/auto.master ] && autofs_mp=$(/bin/grep -e "^/" /etc/auto.master) function precmd () { - local exitstatus="${?}" - PR_STUFF="" - if [[ 0 -ne "${exitstatus}" ]] ; then - PR_STUFF=" ${PR_RED}RET ${exitstatus}${PR_NO_COLOUR}" - fi + PR_EXIT="%{$fg_bold[red]%}%(?..[%?] )%{$reset_color%}" # autofs always complains not being able to mount .hg/ and the like - if echo "$autofs_mp" | grep -qe "^$PWD\s"; then - vcs_info_msg_0_="${PR_YELLOW}[autofs]${PR_NO_COLOUR}" + if echo "$autofs_mp" | /bin/grep -qe "^$PWD\s"; then + vcs_info_msg_0_="[autofs]" else vcs_info fi + + PR_SCREEN="" + if [[ -n "${WINDOW}" ]]; then + PR_SCREEN=" S:${WINDOW}" + fi + + PR_JOBS="" + if [[ $(jobs | wc -l) -gt 0 ]]; then + PR_JOBS=" J:%j" + fi + } -- 2.39.5