~ zanko /.zshrc

autoload -U compinit
compinit
autoload -U zsh-mime-setup
autoload -U zsh-mime-handler
zsh-mime-setup
autoload -U zfinit
zfinit
autoload -U colors
colors

# Completion
zstyle ':completion:*' menu select=2
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle ':completion:*:*:cd:*' tag-order local-directories path-directories
zstyle ':completion:*:rm:*' ignore-line yes
zstyle ':completion:*:mv:*' ignore-line yes
zstyle ':completion:*:cp:*' ignore-line yes

# SSH hosts completion
local _myhosts
if [ -d ~/.ssh ]; then
  if [ -f ~/.ssh/known_hosts ];then
    _myhosts=(${=${${(f)"$(<$HOME/.ssh/known_hosts)"}%%[# ]*}//,/ })
   fi
fi
zstyle ':completion:*' hosts $_myhosts

# Shut up !
unsetopt beep
unsetopt hist_beep
unsetopt list_beep

# Commands correction
setopt correct

# Retire les jokers nuls plutôt que de retourner une erreur
setopt nullglob

# History
export HISTSIZE=1000
export SAVEHIST=1000
export HISTFILE=~/.history
setopt append_history
setopt inc_append_history
#setopt share_history
setopt hist_ignore_dups
#setopt hist_ignore_all_dups
setopt hist_find_no_dups
setopt hist_verify

# Auto cd
setopt autocd

# Prompt definition
prompt="$fg[cyan][$fg[magenta]%T $fg[green]%n@%M$fg[default] $fg[yellow]%~ $fg[red]%#$fg[cyan]]
>$fg[default]"

# Path
#export PATH=$PATH:~/bin

# Lang
#export LANG=fr_FR.UTF-8
#export LC_MESSAGES=fr_FR.UTF-8

# Editor
export EDITOR="nano"
export VISUAL="nano"

# Browser
export BROWSER="lynx"

# Pager
export PAGER="most -C"
alias man="man -P \"most -C\""
alias most="most -C"

# Colour
export CLICOLOR="true"
alias grep='grep --color'
alias egrep='egrep --color'
alias fgrep='fgrep --color'

# Human-readable units
alias du='du -h'
alias df='df -h'

# ls
alias ls="ls -ITFh"

# umask different for root, doesn't work with sudo
#if [[ UID != 0 ]];then
# umask 027
#else
# umask 022
#fi

# Screenshot
screenshot()
{
    sleep 5;
    xwd -root | xwdtopnm 2>/dev/null | pnmtopng >$HOME/capture;
}

# FreeBSD stuff

# Packages source
#export PACKAGESITE=ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7-stable/Latest/

# Find orphan files
#pkg_list_orphans()
#{
#find /usr/local /usr/X11R6 -type f | xargs pkg_which -v | fgrep '?'
#}