Phrodo_00 /.zshrc

Based off someone's else quite a long time ago.
#.zshrc de Phrodo_00
#Archivo de configuración original por Daimeria (http://daimeria.com/)

# Load the super duper completion stuff
autoload -U compinit
compinit

# Colours
# 
# I haven't actually used these yet, apart from for reference. You can use
# these when prompting. Capitalised stuff is bold.

export red=$'%{\e[0;31m%}'
export RED=$'%{\e[1;31m%}'
export green=$'%{\e[0;32m%}'
export GREEN=$'%{\e[1;32m%}'
export blue=$'%{\e[0;34m%}'
export BLUE=$'%{\e[1;34m%}'
export purple=$'%{\e[0;35m%}'
export PURPLE=$'%{\e[1;35m%}'
export cyan=$'%{\e[0;36m%}'
export CYAN=$'%{\e[1;36m%}'
export WHITE=$'%{\e[1;37m%}'
export white=$'%{\e[0;37m%}'
export GREY=$'%{\e[1;30m%}'
export grey=$'%{\e[0;30m%}'
export NC=$'%{\e[0m%}' 

smiley() {
	if [[ $1 = 0 ]]; then
		echo -n ':)'
	else
		echo -n ':('
	fi
}

#PROMPT
precmd() {
	
}
setopt PROMPT_PERCENT
setopt PROMPT_SUBST
PS1="${WHITE}%B%25<...<%~%b${RED}%#${NC} "
RPS1="${purple}%U%n%u${WHITE}@${RED}%m${NC}"

# Aliases
#alias su="su mage"

# Exports
export HOSTTYPE="$(uname -m)"
export COLORTERM=yes
export LINKS_XTERM=screen
export MAILDIR=$HOME/Mail/
export MAIL=$MAILDIR
export CC=gcc
export MANPAGER='most -s '
export PAGER=most
export EDITOR=vim

# SCREENDIR will screw screen up
unset SCREENDIR

# Mail checking
#mailpref=~/Mail
#mailpath=($mailpref/inbox'?New mail'
#          $mailpref/gentoo-user'?New mail in gentoo-user')
# Make sure no cores can be dumped while zsh is in charge. I don't know if
# this limit thing uses ulimit or what, but it seems to work..
limit coredumpsize 0

compctl -g '*(-/)' + -g '.*(-/)' -v cd pushd rmdir
compctl -k hosts -x 'p[2,-1]' -l '' -- rsh ssh

# completion for "man" by Gossamer <gossamer@tertius.net.au> 980827
# This is damn funky. I'm going to do something similar for pinfo,
# hopefully.
compctl -f -x 'S[1][2][3][4][5][6][7][8][9]' -k '(1 2 3 4 5 6 7 8 9)' \
  - 'R[[1-9nlo]|[1-9](|[a-z]),^*]' -K 'match-man' \
  - 's[-M],c[-1,-M]' -g '*(-/)' \
  - 's[-P],c[-1,-P]' -c \
  - 's[-S],s[-1,-S]' -k '( )' \
  - 's[-]' -k '(a d f h k t M P)' \
  - 'p[1,-1]' -c + -K 'match-man' \
  -- man


# Completition
compctl -b bindkey
compctl -v export
compctl -o setopt
compctl -v unset
compctl -o unsetopt
compctl -v vared
compctl -c which
compctl -c sudo

# History stuff
HISTFILE=$HOME/.zshist
HISTSIZE=10000
SAVEHIST=$HISTSIZE
TMPPREFIX=/tmp

# Key bindings, useful.

# key bindings
bindkey "\e[1~" beginning-of-line
bindkey "\e[4~" end-of-line
bindkey "\e[5~" beginning-of-history
bindkey "\e[6~" end-of-history
bindkey "\e[3~" delete-char
bindkey "\e[2~" quoted-insert
bindkey "\e[5C" forward-word
bindkey "\eOc" emacs-forward-word
bindkey "\e[5D" backward-word
bindkey "\eOd" emacs-backward-word
bindkey "\e\e[C" forward-word
bindkey "\e\e[D" backward-word
bindkey "^H" backward-delete-word
# for rxvt
bindkey "\e[8~" end-of-line
bindkey "\e[7~" beginning-of-line
# for non RH/Debian xterm, can't hurt for RH/DEbian xterm
bindkey "\eOH" beginning-of-line
bindkey "\eOF" end-of-line
# for freebsd console
bindkey "\e[H" beginning-of-line
bindkey "\e[F" end-of-line
# completion in the middle of a line
bindkey '^i' expand-or-complete-prefix 

# Aliases, how I love thee
alias vi=vim
alias ls="ls -F --color=always --group-directories-first"
alias la='ls -a -F --color=always --group-directories-first'
alias ll='ls -l -F -h --color=always --group-directories-first'
alias rm='rm -r'
alias rf='rm -rf'
alias cp='cp -r'
alias 'viewglob'='viewglob -c zsh'
alias l='ls --color=always -F --group-directories-first'
alias scp='scp -r'
alias y='yaourt'
alias p='pacman'
alias emacs=gvim
alias t='tail -f'
alias m='time make'
alias make='time make'
alias gcc='time gcc'
alias Suy='sudo pacman -Suy'
alias S='yaourt -S '
alias c='pushd'
alias p='pushd'
alias b='popd'
alias terminal='exec urxvt -cd $(pwd) &'
alias o='xdg-open'

# Set the titlebar for the window, and also the window title in screen :)
#

# This function sets the window tile to user@host:/workingdir before each
# prompt. If you're using screen, it sets the window title (works
# wonderfully for hardstatus lines :)
precmd () {
  [[ -t 1 ]] || return
  case $TERM in
    *xterm*|rxvt|urxvt|rxvt-256color|rxvt-unicode|(dt|k|E|a)term) print -Pn "\e]2;%n@%m:%~\a"
    ;;
    screen*) print -Pn "\e\"%n@%m:%~\e\134"
  esac
}

# This sets the window title to the last run command.
[[ -t 1 ]] || return
case $TERM in
  *xterm*|rxvt|(dt|k|E|a)term)
    preexec () {
      print -Pn "\e]2;$1\a"
    }
  ;;
  screen*)
    preexec () {
      print -Pn "\e\"$1\e\134"
    }
  ;;
esac

# Fixes Savage mouse problems.
export SDL_VIDEO_X11_DGAMOUSE=0

# The following lines were added by compinstall

# zstyle ':completion:*' completer _complete _approximate
# zstyle ':completion:*' format 'Completing %d'
# zstyle ':completion:*' group-name ''
# zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
# zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
# zstyle ':completion:*' matcher-list '+m:{a-z}={A-Z} r:|[._-]=* r:|=*' 'm:{a-z}={A-Z} r:|[._-]=* r:|=*' 'm:{a-z}={A-Z} r:|[._-]=* r:|=*' 'm:{a-z}={A-Z} r:|[._-]=* r:|=*'
# zstyle ':completion:*' max-errors 2
# zstyle ':completion:*' menu select=1
# zstyle ':completion:*' prompt '%{\e[0;31m%}%e%{\e[0m%}'
# zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
# zstyle ':completion:*' squeeze-slashes true
# zstyle :compinstall filename '/home/slarti/.zshrc'
# zstyle ':completion:*' expand 'yes'
# zstyle ':completion::complete:*' '\'

# Select Prompt
zstyle ':completion:*' menu select=1

# Expansion options
zstyle ':completion:*' completer _complete _prefix
zstyle ':completion::prefix-1:*' completer _complete
zstyle ':completion:incremental:*' completer _complete _correct
zstyle ':completion:predict:*' completer _complete

# Completion caching
zstyle ':completion::complete:*' use-cache 1
zstyle ':completion::complete:*' cache-path ~/.zsh/cache/$HOST

# Expand partial paths
zstyle ':completion:*' expand 'yes'
zstyle ':completion:*' squeeze-slashes 'yes'

# Include non-hidden directories in globbed file completions
# for certain commands

zstyle ':completion::complete:*' '\'

# Use menuselection for pid completion
zstyle ':completion:*:*:kill:*' menu yes select
zstyle ':completion:*:kill:*' force-list always
zstyle ':completion:*:processes' command 'ps -au$USER'
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;32'

#  tag-order 'globbed-files directories' all-files 
zstyle ':completion::complete:*:tar:directories' file-patterns '*~.*(-/)'

# Don't complete backup files as executables
zstyle ':completion:*:complete:-command-::commands' ignored-patterns '*\~'

# Separate matches into groups
zstyle ':completion:*:matches' group 'yes'

# With commands like rm, it's annoying if you keep getting offered the same
# file multiple times. This fixes it. Also good for cp, et cetera..
zstyle ':completion:*:rm:*' ignore-line yes
zstyle ':completion:*:cp:*' ignore-line yes

# Describe each match group.
zstyle ':completion:*:descriptions' format "%B---- %d%b"

# Messages/warnings format
zstyle ':completion:*:messages' format '%B%U---- %d%u%b' 
zstyle ':completion:*:warnings' format '%B%U---- no match for: %d%u%b'
 
# Describe options in full
zstyle ':completion:*:options' description 'yes'
zstyle ':completion:*:options' auto-description '%d'

# Simulate spider's old abbrev-expand 3.0.5 patch 
zstyle ':completion:*:history-words' stop verbose
zstyle ':completion:*:history-words' remove-all-dups yes
zstyle ':completion:*:history-words' list false
#pacman completion
zstyle ':completion::complete:pacman:option-S-1:packages' no-select
zstyle ':completion::complete:pacman:option-Q-1:packages' no-select
zstyle ':completion::complete:pacman:option-R-1:packages' no-select
zstyle ':completion::complete:pacman:option-A-1:files' file-paterns '*.pkg.tar.gz'
# Follow GNU LS_COLORS
zmodload -i zsh/complist
#eval "`dircolors ~/.dir_colors`"
export ZLSCOLORS="${LS_COLORS}"
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
zstyle ':completion:*:*:kill:*' list-colors '=%*=01;31'

_force_rehash() {
  (( CURRENT == 1 )) && rehash
  return 1    # Because we didn't really complete anything
}

zstyle ':completion:*' completer \
  _oldlist _expand _force_rehash _complete

# zsh Options. Big long lovely way of setting them.

setopt                       \
     NO_all_export           \
        always_last_prompt   \
        always_to_end        \
        append_history       \
        auto_cd              \
        auto_list            \
        auto_menu            \
        auto_name_dirs       \
        auto_param_keys      \
        auto_param_slash     \
        auto_pushd           \
        auto_remove_slash    \
     NO_auto_resume          \
        bad_pattern          \
        bang_hist            \
     NO_beep                 \
        brace_ccl            \
        correct_all          \
     NO_bsd_echo             \
        cdable_vars          \
     NO_chase_links          \
        clobber              \
        complete_aliases     \
        complete_in_word     \
        correct              \
     NO_correct_all          \
        csh_junkie_history   \
     NO_csh_junkie_loops     \
     NO_csh_junkie_quotes    \
     NO_csh_null_glob        \
        equals               \
        extended_glob        \
        extended_history     \
        function_argzero     \
        glob                 \
     NO_glob_assign          \
        glob_complete        \
     NO_glob_dots            \
        glob_subst           \
     NO_hash_cmds            \
     NO_hash_dirs            \
        hash_list_all        \
        hist_allow_clobber   \
        hist_beep            \
        hist_ignore_dups     \
        hist_ignore_space    \
     NO_hist_no_store        \
        hist_verify          \
     NO_hup                  \
     NO_ignore_braces        \
     NO_ignore_eof           \
        interactive_comments \
      	inc_append_history   \
     NO_list_ambiguous       \
     NO_list_beep            \
        list_types           \
        long_list_jobs       \
        magic_equal_subst    \
     NO_mail_warning         \
     NO_mark_dirs            \
        menu_complete        \
        multios              \
        nomatch              \
        notify               \
     NO_null_glob            \
        numeric_glob_sort    \
     NO_overstrike           \
        path_dirs            \
        posix_builtins       \
     NO_print_exit_value     \
     NO_prompt_cr            \
        prompt_subst         \
        pushd_ignore_dups    \
     NO_pushd_minus          \
        pushd_silent         \
        pushd_to_home        \
        rc_expand_param      \
     NO_rc_quotes            \
     NO_rm_star_silent       \
     NO_sh_file_expansion    \
        sh_option_letters    \
        short_loops          \
     NO_sh_word_split        \
     NO_single_line_zle      \
     NO_sun_keyboard_hack    \
        unset                \
     NO_verbose              \
        zle
#inicia ViewGlob si se está en las X y si viewglob no está activo.
# if [ -z "$VG_VIEWGLOB_ACTIVE" ] && [ "$DISPLAY" ]
#    then exec viewglob -c zsh
#fi