local colors typeset -A colors colors[red]="%{%}" colors[green]="%{%}" colors[yellow]="%{%}" colors[blue]="%{%}" colors[purple]="%{%}" colors[cyan]="%{%}" colors[white]="%{%}" colors[brown]="%{%}" colors[grey]="%{%}" colors[underline]="%{%}" colors[clear]="%{%}" local USERCOLOR=$colors[green] if [[ "$UID" -eq 0 ]]; then USERCOLOR=$colors[red] fi export PROMPT="$USERCOLOR%m$colors[clear]%# " local MYRPROMPT="%~" export RPROMPT=$MYRPROMPT export PATH=$PATH:$HOME/bin alias l='ls -aF --color' alias ll='l -l' function vv() { file=$1 if [[ "`ps ax | grep gvim | grep -v grep`x" == "x" ]]; then gvim --servername xgvim $file else gvim --servername xgvim --remote $file fi } bindkey ^A beginning-of-line bindkey ^E end-of-line bindkey '[1~' beginning-of-line bindkey '[2~' overwrite-mode bindkey '[3~' delete-char bindkey '[4~' end-of-line #bindkey '[5~' history-search-backward #bindkey '[6~' history-search-forward if [[ "$UID" != 0 && -z `ps aux|grep -E "$USER.+ssh\-agent"|grep -v grep|awk '{print $5}'` ]]; then ssh-agent > ~/.ssh/agent.info source ~/.ssh/agent.info > /dev/null 2>&1 else source ~/.ssh/agent.info > /dev/null 2>&1 fi switch-rprompt() { if [[ -z "$RPROMPT" ]]; then setopt localoptions extendedglob export RPROMPT="$MYRPROMPT" RBUFFER="${RBUFFER%% #}" else export RPROMPT="" RBUFFER="$RBUFFER${(l:COLUMNS:: :):-}" fi } break-prompt() { setopt localoptions noksharrays if [[ "$BUFFER" == $'\\\n'* ]]; then ((CURSOR -= 2)) BUFFER="$BUFFER[3,-1]" else LBUFFER=$'\\\n'"$LBUFFER" fi } zle -N switch-rprompt zle -N break-prompt bindkey ^O switch-rprompt bindkey ^P break-prompt export LC_ALL=C export LC_TYPE=ISO-8859-1 export LC_CTYPE=de_DE.ISO-8859-1