~ roboflop /.zshrc

## roboflop

# History options
setopt INC_APPEND_HISTORY
setopt SHARE_HISTORY
setopt APPEND_HISTORY
setopt HIST_IGNORE_DUPS
setopt EXTENDED_HISTORY

# Make background execution not have a lower priority
unsetopt BG_NICE

setopt MENUCOMPLETE
setopt AUTO_LIST
setopt AUTO_MENU
setopt LONG_LIST_JOBS
setopt AUTO_PARAM_SLASH

setopt ALL_EXPORT

HISTFILE=~/.histfile
HISTSIZE=5000
SAVEHIST=5000
HOSTNAME="`hostname`"
PAGER='less'
EDITOR='vim'

# Path
PATH="/bin:/usr/bin:/sbin:/usr/sbin:/home/rand/bin:"

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_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
  eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'
  (( count = $count + 1 ))
    done
    PR_NO_COLOR="%{$terminfo[sgr0]%}"
PS1="[$PR_BLUE%n$PR_WHITE@$PR_GREEN%m$PR_NO_COLOR] "
RPS1="($PR_WHITE%d$PR_NO_COLOR)"

# Language stuff
LC_CTYPE='sv_SE.ISO8859-1'
LESSCHARSET='latin1'
CHARSET='ISO-8859-1'

# Dir colors
zmodload -i zsh/complist
eval $(dircolors ~/.dircolors)
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}

unsetopt ALL_EXPORT

autoload -Uz compinit
compinit

bindkey '\e[2~' yank
bindkey '\e[3~' delete-char
#bindkey "^?" backward-delete-char
bindkey '\e[7~' beginning-of-line
bindkey '\e[8~' end-of-line
bindkey '\e[5~' up-line-or-history
bindkey '\e[6~' down-line-or-history
#bindkey "\er" history-incremental-search-backward
bindkey ' ' magic-space    # also do history expansion on space
#bindkey '\eI' complete-word # complete on tab, leave expansion to _expand
zstyle ':completion::complete:*' use-cache on
zstyle ':completion::complete:*' cache-path ~/.zsh/cache/$HOST


zstyle ':completion:*' list-prompt '%SAt %p: Hit TAB for more, or the character to insert%s'
zstyle ':completion:*' menu select=1 _complete _ignored _approximate
zstyle -e ':completion:*:approximate:*' max-errors \
    'reply=( $(( ($#PREFIX+$#SUFFIX)/2 )) numeric )'
zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s'


# list of completers to use
zstyle ':completion:*::::' completer _expand _complete _ignored _approximate
# allow one error for every three characters typed in approximate completer
zstyle -e ':completion:*:approximate:*' max-errors \
    'reply=( $(( ($#PREFIX+$#SUFFIX)/2 )) numeric )'
       
# insert all expansions for expand completer
zstyle ':completion:*:expand:*' tag-order all-expansions

# formatting and messages
zstyle ':completion:*' verbose yes
zstyle ':completion:*:descriptions' format '%B%d%b'
zstyle ':completion:*:messages' format '%d'
zstyle ':completion:*:warnings' format 'No matches for: %d'
zstyle ':completion:*:corrections' format '%B%d (errors: %e)%b'
zstyle ':completion:*' group-name ''

# match uppercase from lowercase
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'

# offer indexes before parameters in subscripts
zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters

# command for process lists, the local web server details and host completion
# on processes completion complete all user processes
#zstyle ':completion:*:processes' command 'ps -au$USER'

# add colors to processes for kill completion
#zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'
zstyle ':completion:*:*:kill:*' list-colors '=%*=01;31'
#zstyle ':completion:*:processes' command 'ps ax -o pid,s,nice,stime,args | sed "/ps/d"'
zstyle ':completion:*:*:kill:*:processes' command 'ps --forest -A -o pid,user,cmd'
#zstyle ':completion:*:processes-names' command 'ps axho command' 
zstyle :compinstall filename '/home/rand/.zshrc'

# ignore _functions
zstyle ':completion:*:functions' ignored-patterns '_*'

## alias stuff
alias ls='ls --color'
alias ll='ls -al'