# Get the only language computers should speak
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

# Extra PATH
export PATH=$PATH:~/git/misc:/usr/local/go/bin:/Applications/MySQLWorkbench.app/Contents/MacOS/:/Applications/Postgres.app//ontents/Versions/10/bin/

# Some programs honour this
export LC_PAPER=a4

# Get termcolors
source ~/.termcolors

#prompt="%S(%n@%m)%s %3c> "
prompt="$CYAN%T$NORMAL %n@%m:$BRIGHT$CYAN%30<..<%~/$NORMAL > " 

# It's nice, but too annoying when copy/pasting
#RPROMPT="[%T]"
unset RPROMPT

# History
HISTSIZE=5000
HISTFILE=${HOME}/.zsh_history
SAVEHIST=5000

# I am capable of checking mail myself.
unset MAILCHECK

# pushd on every cd is nice
setopt auto_pushd

# No CR to screw output
setopt nopromptcr

# Correction sucks!
setopt nocorrect
setopt nocorrectall

# setopt auto_cd
setopt print_exit_value
unsetopt bg_nice
unsetopt hup

# History completion
autoload -U up-line-or-beginning-search
autoload -U down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey "^[[A" up-line-or-beginning-search
bindkey "^[[B" down-line-or-beginning-search

# Kill parts of a path with ESC-backspace
autoload -U bash-backward-kill-word
zle -N bash-backward-kill-word
bindkey "^[^?" bash-backward-kill-word

# Make the shell's have titlebar with hostname etc.
if [ $TERM = "xterm" ]; then 
	echo "\033]2;`uname -n`  `uname -sr` \007\033]1";
fi

# The nice ZSH completion
autoload -U compinit
compinit

# Completion on .ssh/known_hosts
zstyle -e ':completion:*:ssh:*' hosts 'reply=($(sed -e "/^#/d" -e "s/ .*\$//" -e "s/,/ /g" /etc/ssh_known_hosts ~/.ssh/known_hosts ~/.ssh/known_hosts2 2>/dev/null))'

# Make sure that ssh auth sock is still valid after detach/attach screen
if [ "$STY" = "" ] ; then
	rm ~/.ssh/authsock
	ln -s $SSH_AUTH_SOCK ~/.ssh/authsock
else
	export SSH_AUTH_SOCK=~/.ssh/authsock
fi

# Completion so "cd ..<TAB>" -> "cd ../"
# zstyle ':completion:*' special-dirs ..



