autoload -U compinit
compinit

#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
#setopt APPEND_HISTORY
## for sharing history between zsh processes
#setopt INC_APPEND_HISTORY
setopt SHARE_HISTORY
SAVEHIST=500
HISTFILE=~/.zsh_history

## 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

alias e="emacs -nw -q"
alias et="emacs -nw"
alias etr="aterm -tr -trsb -sh 50 -fg Grey -tn xterm-256color -e emacs -nw"
alias mplayer-bw="mplayer -vf format=y8,scale"
alias firefox="pasuspender -- firefox"
alias mct="mc -abds"
alias l="ls -l"
alias purge="rm -f ./*~"
alias j="jmacs"

alias en="LANG=en_US.utf8"
alias jp="LANG=ja_JP.utf8"
alias zh="LANG=zh_CN.utf8"
alias ch="LANG=zh_TW.utf8"
alias hu="LANG=hu_HU.utf8"

alias jwp="wine /home/salvi/.wine/drive_c/Program\ Files/JWPce/jwpce.exe"
alias wenlin="wine /home/salvi/.wine/drive_c/Program\ Files/Wenlin3/Wenlin.exe"

export BROWSER="google-chrome"
export PS1='%n@%m:%~ $ '
export LD_LIBRARY_PATH=/usr/local/lib
export PATH=$HOME/bin:$PATH
export XMODIFIERS=@im=SCIM
export TEXINPUTS=$TEXINPUTS:$HOME/share/TeX/prosper
export HBFPATH="/usr/local/share/cnprint"
if [[ $TERM == dumb ]]; then
    # We are in Emacs
    export EDITOR=emacsclient
else
    # We are in some other terminal
    export EDITOR=jmacs
fi
export CVS_RSH=/usr/bin/ssh
export SBCL_HOME=/usr/lib/sbcl

# Force Xdefaults parsing
xrdb -merge ~/.Xdefaults &> /dev/null

# Rodin
export SCMDIR=/home/salvi/project/fairing/Rodin/scm
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH::/home/salvi/project/fairing/Rodin/scm/_bin

# CUDA
export PATH=$PATH:/usr/cuda/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/cuda/lib

# Android
export PATH=$PATH:/home/salvi/share/adt-bundle-linux-x86-20140321/sdk/tools
export PATH=$PATH:/home/salvi/share/adt-bundle-linux-x86-20140321/sdk/platform-tools

# Current directory
export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH

# Scala
export SCALA_HOME=~/share/scala
export PATH=$PATH:$SCALA_HOME/bin

# OCaml
# eval `opam config env`
