# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
   typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet
  source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

PLATFORM=$(uname -s)

ZSH="${HOME}/.oh-my-zsh"
#ZSH_THEME="powerlevel10k/powerlevel10k"
ZSH_THEME="bureau"


plugins=(z git ssh-agent zsh-autosuggestions zsh-navigation-tools ag docker)
[ $PLATFORM = 'Darwin' ] && plugins+=(macos)

# SSH Agent Config
zstyle :omz:plugins:ssh-agent agent-forwarding on
zstyle :omz:plugins:ssh-agent quiet yes
zstyle :omz:plugins:ssh-agent identities id_rsa github/github_key

source $ZSH/oh-my-zsh.sh

alias zshconfig="vim ~/.zshrc"
alias ohmyzsh="vim ~/.oh-my-zsh"
alias ls='lsd -F --color=auto'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'

alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'

alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias irc='screen irssi -c irc.freenode.net'
alias magerun="php -d'error_reporting=E_ALL & ~E_DEPRECATED' /usr/local/bin/magerun.phar"
alias magerun.phar="php -d'error_reporting=E_ALL & ~E_DEPRECATED' /usr/local/bin/magerun.phar"

# Stop annoying 'did you mean sudo .vim'
alias sudo="nocorrect sudo"

alias v='vagrant'
alias vup="vagrant up --no-provision"
alias vdown="vagrant halt"

source ~/.bash_functions
source ~/.bash_aliases

export LESS="-r"
if [ $PLATFORM = 'Darwin' ]; then
  path=("/usr/local/opt/coreutils/libexec/gnubin" $path)
  path=("/usr/local/opt/findutils/libexec/gnubin" $path)
  path=("/usr/local/opt/libtool/libexec/gnubin" $path)
  path=("/usr/local/opt/gawk/libexec/gnubin" $path)
  path=("/usr/local/opt/gnu-sed/libexec/gnubin" $path)
  path=("/usr/local/opt/gnu-tar/libexec/gnubin" $path)
  path=("/usr/local/opt/curl/bin" $path)
  path=("/Applications/VMware Fusion.app/Contents/Library" $path)
  export MANPATH="/usr/local/share/man:$MANPATH"
  export MANPATH="/usr/local/opt/curl/share/man:$MANPATH"
  export MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH"
  export MANPATH="/usr/local/opt/gnu-sed/libexec/gnuman:$MANPATH"
  fpath=(/usr/local/share/zsh-completions $fpath)
  [ -s "${HOME}/homebrew_env.sh" ] && source "${HOME}/homebrew_env.sh"
  [ -s "${HOME}/.iterm2_shell_integration.zsh" ] && source "${HOME}/.iterm2_shell_integration.zsh"
fi

[ -e ${HOME}/.dircolors ] && eval $(dircolors ${HOME}/.dircolors)

# Load any private env vars
[ -s "${HOME}/.bash_private" ] && source "${HOME}/.bash_private"

export PATH="$HOME/.composer/vendor/bin:$PATH"
export PATH="vendor/bin:$PATH"
export PATH="node_modules/.bin:$PATH"

if [ $PLATFORM = 'Darwin' ]; then
  export PATH="/usr/local/opt/mysql-client/bin:$PATH"
  export PATH="/usr/local/opt/ruby/bin:$PATH"
fi
export PATH="/usr/local/sbin:$PATH"

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
