dotfiles/.zshrc
michener 6cc6a51cb7 zsh updates
git-svn-id: http://photonzero.com/dotfiles/trunk@25 23f722f6-122a-0410-8cef-c75bd312dd78
2008-09-30 23:32:16 +00:00

52 lines
1.2 KiB
Bash

#complist
autoload -U compinit
compinit
setopt extended_glob
bindkey -v
ZLS_COLORS=$LS_COLORS
setopt prompt_subst
###
# See if we can use colors.
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_LIGHT_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
eval PR_$color='%{$fg[${(L)color}]%}'
(( count = $count + 1 ))
done
PR_NO_COLOUR="%{$terminfo[sgr0]%}"
###
# Decide whether to set a screen title
if [[ "$TERM" == "screen" ]]; then
PR_STITLE=$'%{\ekzsh\e\\%}'
else
PR_STITLE=''
fi
preexec () {
local CMD="${1/#sudo /#}"
local CMD="${CMD/#nano /}"
local CMD="${CMD/#ssh />}"
$SCREENME true || echo -ne "\ek${CMD%% *}\e\\"
}
precmd () {
$SCREENME true || echo -ne "\ekzsh\e\\"
}
PROMPT='$PR_STITLE$PR_LIGHT_BLUE($PR_LIGHT_YELLOW%D{%H:%M}|%!$PR_BLUE%)[%(!.$PR_RED.$PR_GREEN)%n@%m$PR_LIGHT_CYAN %~$PR_BLUE]$PR_NO_COLOUR%(!.#.$) '
#source .zshprompt
source ~/.zsh_profile
source ~/.bash_aliases
source ~/.zshenv
if [ -n "`which fortune`" ]; then
fortune
fi