~ worklez /.zshrc

zshrc + gentoo (non-root) prompt theme
autoload -U compinit
compinit

autoload -U promptinit
promptinit
prompt_gentoo_prompt=${1:-'blue'}
prompt_gentoo_user=${2:-'green'}
prompt_gentoo_root=${3:-'red'}

base_prompt="%{$fg_bold[$prompt_gentoo_user]%}%n@%m%{$reset_color%} "

post_prompt="%{$reset_color%}"

color="%{*}"
base_prompt_no_color="${(S)base_prompt//${~color}/}"
post_prompt_no_color="${(S)post_prompt//${~color}/}"

setopt noxtrace localoptions
local base_prompt_expanded_no_color base_prompt_etc
local prompt_length space_left

base_prompt_expanded_no_color=$(print -P "$base_prompt_no_color")
base_prompt_etc=$(print -P "$base_prompt%(4~|...|)%3~")
prompt_length=${#base_prompt_etc}
path_prompt="%{$fg_bold[$prompt_gentoo_prompt]%}%1~"
PS1="$base_prompt$path_prompt %# $post_prompt"
PS2="$base_prompt$path_prompt %_> $post_prompt"
PS3="$base_prompt$path_prompt ?# $post_prompt"
#prompt gentoo
RPROMPT="%*"

#setopt correctall
setopt hist_ignore_all_dups
setopt extendedglob

zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:*:processes' command 'ps -xuf'
zstyle ':completion:*:processes' sort false
zstyle ':completion:*:processes-names' command 'ps xho command'

HISTFILE=~/.histfile
HISTSIZE=50000
SAVEHIST=50000
autoload -U zcalc
case $TERM in
         *term* | rxvt* | *screen*)
                 precmd() { print -Pn "\e]0;%n@%m:%~ -> %l\a" } ;
                postexec() { print -Pn "\e]0;%n@%m:%~ -> %l\a" } ;
                preexec() { print -Pn "\e]0;%n@%m:%~ -> %l -> $1\a" } ;;
esac
case $TERM in
        *linux)
        bindkey "^[[2~" yank
        bindkey "^[[3~" delete-char
        bindkey "^[[5~" up-line-or-history
        bindkey "^[[6~" down-line-or-history
        bindkey "^[[1~" beginning-of-line
        bindkey "^[[4~" end-of-line
        bindkey "^[e" expand-cmd-path
        bindkey "^[[A" up-line-or-search
        bindkey "^[[B" down-line-or-search
        bindkey " " magic-space
        ;;
*xterm*|*rxvt*|(dt|k|E)term)
        bindkey "^[[2~" yank
        bindkey "^[[3~" delete-char
        bindkey "^[[5~" up-line-or-history
        bindkey "^[[6~" down-line-or-historye
        bindkey "^[[7~" beginning-of-line
        bindkey "^[[8~" end-of-line
        bindkey "^[e" expand-cmd-path ## C-e for expanding path of typed command
        bindkey "^[[A" up-line-or-search ## up arrow for back-history-search
        bindkey "^[[B" down-line-or-search ## down arrow for fwd-history-search
        bindkey " " magic-space ## do history expansion on space
        ;;
esac
alias ls="ls --color=auto"
alias gcc="gcc -ansi -O3 -Wall"