# UMask
umask 077

# Completion
zstyle ':completion:*' completer _expand _complete _correct _approximate
zstyle ':completion:*:sudo:*' command-path /usr/local/sbin /usr/local/bin \
	/usr/sbin /usr/bin /sbin /bin /usr/X11R6/bin
zstyle ':completion:*:expand:*' tag-order all-expansions
zstyle ':completion:*' hosts $(hosts)
autoload -Uz compinit
compinit
setopt hist_ignore_dups
setopt extendedhistory
setopt extendedglob

# Command edition
autoload edit-command-line
zle -N edit-command-line
autoload run-help

# Terminal title
case $TERM in
	*linux)
		# NOOP
		;;
	xterm*|rxvt*|urxvt*)
		preexec() { print -Pn "\e]0;%n@%m:%3~ {${1%% *}}\a" }
		precmd() { print -Pn "\e]0;%n@%m:%3~\a" }
		;;
	screen*)
		preexec() { print -Pn "\e]2;%n@%m:%3~ {${1%% *}}\a" }
		precmd() { print -Pn "\e]2;%n@%m:%3~\a" }
		;;
esac

# Aliases
source ~/conf/zsh/aliases

# Functions
source ~/conf/zsh/functions

# Bindkeys
source ~/conf/zsh/bindkeys

# Highlight
source ~/conf/zsh/highlight