projects
/
shutils.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
0e6e94c
)
zshrc: update
author
Stefan Huber <s.huber@bct-electronic.com>
Wed, 7 Nov 2012 13:52:40 +0000
(14:52 +0100)
committer
Stefan Huber <s.huber@bct-electronic.com>
Wed, 7 Nov 2012 13:52:40 +0000
(14:52 +0100)
dotfiles/zshrc
patch
|
blob
|
history
diff --git
a/dotfiles/zshrc
b/dotfiles/zshrc
index 336bd92ff6125c5fde856c6d26415c313fd19f50..877798900e514ab6f400869bdd218fe2256f4f3c 100644
(file)
--- a/
dotfiles/zshrc
+++ b/
dotfiles/zshrc
@@
-1,3
+1,5
@@
+# sample by Peter Palfrader: http://svn.noreply.org/svn/weaselutils/trunk/dotfiles/zshrc
+
[ -r /etc/zsh/zprofile ] && source /etc/zsh/zprofile
[ -r $HOME/.profile ] && source $HOME/.profile
[ -r /etc/zsh/zprofile ] && source /etc/zsh/zprofile
[ -r $HOME/.profile ] && source $HOME/.profile
@@
-14,8
+16,6
@@
if [ -e $HOME/.bash_completion ]; then
source $HOME/.bash_completion
fi
source $HOME/.bash_completion
fi
-
-
autoload colors zsh/terminfo
if [[ "$terminfo[colors]" -ge 8 ]]; then
colors
autoload colors zsh/terminfo
if [[ "$terminfo[colors]" -ge 8 ]]; then
colors
@@
-70,10
+70,18
@@
setopt \
NO_HUP
NO_HUP
+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}]%}'
+done
+PR_BOLD="%{$terminfo[bold]%}"
+PR_NO_COLOUR="%{$terminfo[sgr0]%}"
+
HISTFILE=~/.zsh_history
HISTSIZE=50000
SAVEHIST=50000
REPORTTIME=5
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]"
autoload -Uz vcs_info && vcs_info
zstyle ':vcs_info:*' enable git cvs svn hg
autoload -Uz vcs_info && vcs_info
zstyle ':vcs_info:*' enable git cvs svn hg
@@
-81,26
+89,27
@@
zstyle ':vcs_info:*' use-prompt-escapes
zstyle ':vcs_info:*' max-exports 1
zstyle ':vcs_info:*' max-exports 1
-function setprompt() {
-
- 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}]%}'
- done
- PR_BOLD="%{$terminfo[bold]%}"
- PR_NO_COLOUR="%{$terminfo[sgr0]%}"
-
+function setprompt()
+{
+ # default: " (%s)-[%b|%a]%u%c-"
zstyle ':vcs_info:*' actionformats "${PR_YELLOW}%s:%b|%a${PR_NO_COLOUR} "
zstyle ':vcs_info:*' actionformats "${PR_YELLOW}%s:%b|%a${PR_NO_COLOUR} "
+ # default: " (%s)-[%b]%u%c-"
zstyle ':vcs_info:*' formats "${PR_YELLOW}%s:%b${PR_NO_COLOUR} "
setopt PROMPT_SUBST
PROMPT='%(!.$PR_RED.$PR_GREEN)%n@%m $PR_BLUE%1~ %# $PR_NO_COLOUR'
zstyle ':vcs_info:*' formats "${PR_YELLOW}%s:%b${PR_NO_COLOUR} "
setopt PROMPT_SUBST
PROMPT='%(!.$PR_RED.$PR_GREEN)%n@%m $PR_BLUE%1~ %# $PR_NO_COLOUR'
- RPROMPT='${vcs_info_msg_0_}$
PR_CYAN?%?$PR_NO_COLOUR
'
+ RPROMPT='${vcs_info_msg_0_}$
{PR_STUFF}
'
}
setprompt
}
setprompt
-function precmd () {
+function precmd ()
+{
+ local exitstatus="${?}"
+ PR_STUFF=" "
+ if [[ 0 -ne "${exitstatus}" ]] ; then
+ PR_STUFF="${PR_RED}RET ${exitstatus}${PR_NO_COLOUR}"
+ fi
vcs_info
}
vcs_info
}