function create_dir() [ ! -d "$1" ] && mkdir -p "$1"
function safe_source() [ -f "$1" ] && source "$1"
function zsh_add_file() safe_source "$ZDOTDIR/$1"

zsh_add_file "zsh-aliases"
zsh_add_file "zsh-functions"
zsh_add_file "zsh-options"

zsh_add_plugin "Aloxaf/fzf-tab"
zsh_add_plugin "ahmubashshir/zinsults"
zsh_add_plugin "zdharma-continuum/fast-syntax-highlighting"
zsh_add_plugin "zsh-users/zsh-autosuggestions"
zsh_add_plugin "zsh-users/zsh-completions"

create_dir "$HOME/.cache/zsh"
autoload -Uz compinit && compinit -d "$HOME/.cache/zsh/zcompdump"
zmodload zsh/complist
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'

autoload -z edit-command-line
zle -N edit-command-line

bindkey "^V" edit-command-line
bindkey '^K' autosuggest-execute

# vim: filetype=zsh