#
# .zshrc is sourced in interactive shells.
# It should contain commands to set up aliases,
# functions, options, key bindings, etc.
#

source /etc/profile

autoload -U compinit
compinit
autoload -U predict-on
predict-on
zle -N predict-on
zle -N predict-off
autoload -U zcalc
autoload -U tetris
zle -N tetris
autoload -Uz ztodo
chpwd() { ztodo }


zmodload zsh/complist
zmodload -a zsh/stat stat
zmodload -a zsh/zpty zpty
zmodload -a zsh/zprof zprof
zmodload -ap zsh/mapfile mapfile
setopt menucomplete
zstyle ':completion:*' menu yes select
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'
setopt autocd

#allow tab completion in the middle of a word
setopt COMPLETE_IN_WORD

## keep background processes at full speed
#setopt NOBGNICE
## restart running processes on exit
#setopt HUP

## history
HISTFILE=~/.zhistory
HISTSIZE=1024
SAVEHIST=1024
setopt APPEND_HISTORY
## for sharing history between zsh processes
setopt INC_APPEND_HISTORY
setopt HIST_IGNORE_ALL_DUPS
setopt SHARE_HISTORY
setopt HIST_IGNORE_SPACE
setopt HIST_REDUCE_BLANKS
setopt extendedglob
DIRSTACKSIZE=20

## never ever beep ever
#setopt NO_BEEP

## automatically decide when to page a list of completions
#LISTMAX=0

## disable mail checking
MAILCHECK=0

autoload -U colors
colors

bindkey -v
bindkey "\e[1~" beginning-of-line
bindkey "\e[2~" transpose-words
bindkey "\e[3~" delete-char
bindkey "\e[4~" end-of-line
bindkey "^[[5~" up-line-or-history
bindkey "^[[6~" down-line-or-history
bindkey "^[[7~" beginning-of-line
bindkey "^[[8~" end-of-line
bindkey "\eOH" beginning-of-line
bindkey "\eOF" end-of-line
bindkey "\e[H" beginning-of-line
bindkey "\e[F" end-of-line
bindkey "^X^X" predict-on
bindkey "^X^Z" predict-off
bindkey "^T" tetris

alias -g h=' --help|less'

alias -s pdf=evince
alias -s avi=mplayer
alias -s htm=view_html
alias -s html=view_html
alias -s jpg=view_img
alias -s jpeg=view_img
alias -s gif=view_img
alias -s png=view_img
alias -s mp3=xmms
alias -s flac=xmms
alias -s djvu=djview
alias -s ps=evince
alias -s gz=view_gz
alias -s bz2=view_bz2
alias -s exe=wine
alias -s odb=oo
alias -s odt=oo
alias -s odp=oo
alias -s doc=oo
alias -s xls=oo
alias -s xml=ff
alias -s iso=showiso
alias -s fb2=FBReader

alias ipt="sudo vim /etc/sysconfig/iptables && sudo /etc/init.d/iptables restart"
alias m=mplayer 
alias v=vim 
alias la='ls -A'
alias ll='ls -lh'
alias lla='ls -A -lh'
alias lal='ls -A |less'
alias llal='ls -A -lh |less'
alias mc='bash -c "mc -c"'
alias xterm_='xterm -bg black -fg gray60 /bin/bash'
alias xterm='xterm_ &'
alias df='df -h'
alias init='sudo init'
alias ii='sudo init 3'
alias i5='sudo init 5'
alias e='killall -TERM fluxbox'
alias K='killp'
#alias a=$1

hash -d my=/opt/._
hash -d fl=/media/usbdisk
hash -d u=/media/usbfat
hash -d h=/media/usbdisk/2home
hash -d i=/etc/init.d
hash -d tc=/mnt/iais/tomcat
hash -d w=/mnt/iais/tomcat/webapps.iais
hash -d dekanat=/mnt/iais/tomcat/webapps.iais/dekanat

PS1=$(echo '%{\033[36m%}%~>%{\033[37m%} ')
RPS1=$(echo '%{\033[36m%}')\$$HOSTNAME/$WINDOW$(echo '%{\033[37m%} ')
precmd()
{
	print -Pn "\033]0;%/\a"
}
EDITOR=vim
#PLAN9=/opt/._/dst/wmii-3.6/plan9
if [ "$MANPATH" = "" ]; then
	MANPATH=/opt/local/share/man
else
	MANPATH=/opt/local/share/man:$MANPATH
fi
PATH=$HOME/bin:/opt/bin:/opt/local/bin:$PATH:/sbin:/usr/sbin:/usr/local/sbin

