# Load the functions, aliases and exports
for file in ~/dotfiles/zsh/{antigen.zsh,exports,aliases,functions}; do
  [ -r "$file" ] && source "$file"
done
unset file

# plugins
antigen use belak/zsh-utils
antigen bundle zsh-users/zsh-syntax-highlighting
antigen bundle zsh-users/zsh-completions
antigen bundle zsh-users/zsh-autosuggestions
antigen bundle history
antigen bundle completion
antigen apply

# history
setopt SHARE_HISTORY
unsetopt HIST_BEEP

# a nice prompt, install it via npm to make this work
autoload -U promptinit; promptinit
prompt pure

# completions
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
compdef g=git
compdef gf=git-flow

# easy vim/terminal switch
zle -N fancy-ctrl-z
bindkey '^Z' fancy-ctrl-z

# smart urls
autoload -U url-quote-magic
zle -N self-insert url-quote-magic

# other tools init
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
eval "$(jump shell)"
eval "$(rbenv init -)"
eval "$(pyenv init -)"
