# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH

export ZSH=/usr/share/oh-my-zsh

# Path to your oh-my-zsh installation.

#POWERLEVEL9K_MODE='nerdfont-complete'
#
#POWERLEVEL9K_FOLDER_ICON=""
#
#POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=0
#
#POWERLEVEL9K_DIR_OMIT_FIRST_CHARACTER=true
#
#POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND='black'
#POWERLEVEL9K_BACKGROUND_JOBS_BACKGROUND='178'
#POWERLEVEL9K_VCS_CLEAN_BACKGROUND='green'
#POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND='yellow'
#POWERLEVEL9K_VCS_MODIFIED_BACKGROUND='016'
#POWERLEVEL9K_VIRTUALENV_BACKGROUND='green'
#POWERLEVEL9K_CONTEXT_DEFAULT_FOREGROUND="blue"
#POWERLEVEL9K_DIR_WRITABLE_FORBIDDEN_FOREGROUND="015"
#POWERLEVEL9K_NODE_VERSION_BACKGROUND="034"
#POWERLEVEL9K_JAVA_VERSION_BACKGROUND="016"
#POWERLEVEL9K_TIME_BACKGROUND='255'
#POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND='245'
#POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND='black'
#POWERLEVEL9K_SHORTEN_DIR_LENGTH=2
#
#POWERLEVEL9K_TIME_FORMAT="%D{%H:%M}"


#P9K__LEFT=(root_indicator dir dir_writable virtualenv vcs)
#P9K__RIGHT=(status background_jobs command_execution_time)
#
#function chpwd {
#    if [[ $PWD/ == ${HOME}/Documents/Development/Node/* ]]; then
#        POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=("${P9K__RIGHT[@]:0:2}" "node_version" "${P9K__RIGHT[@]:2}")
#    elif [[ $PWD/ == ${HOME}/Documents/Development/Java/* ]]; then
#        POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=("${P9K__RIGHT[@]:0:2}" "java_version" "${P9K__RIGHT[@]:2}")
#    elif [[ $PWD/ == ${HOME}/Documents/School/OGP/* ]]; then
#        POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=("${P9K__RIGHT[@]:0:2}" "java_version" "${P9K__RIGHT[@]:2}")
#    else
#    	POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(${P9K__RIGHT})
#    fi
#}

#POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(${P9K__LEFT})
#POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(${P9K__RIGHT})

#POWERLEVEL9K_SHOW_CHANGESET=true

HYPHEN_INSENSITIVE="true"
COMPLETION_WAITING_DOTS="true"

#source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme
ZSH_THEME="avit"

alias nodeindex="node lib/index.js"

plugins=(
  git
  archlinux
  k tig gitfast colored-man colorize command-not-found cp dirhistory autojump sudo zsh-syntax-highlighting
)

ZSH_COMPDUMP=/tmp/zcompdump-$USER
source $ZSH/oh-my-zsh.sh

HYPHEN_INSENSITIVE="true"
COMPLETION_WAITING_DOTS="true"

ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern cursor)

# User configuration

export MANPATH="/usr/local/man:$MANPATH"
export LANG=en_US.UTF-8
export BROWSER=/usr/bin/chromium
export EDITOR=/usr/bin/vim
export TERM="xterm-256color"
export LC_ALL=en_GB.utf8
export QT_QPA_PLATFORMTHEME="qt5ct"

if [[ -d $HOME/.emacs.d/bin && -z $(echo $PATH | grep -o $HOME/.emacs.d/bin) ]]
then
    export PATH="${PATH}:$HOME/.emacs.d/bin"
fi

# TP Stuff

declare -A beacons=(
    [doc]="${HOME}/Documents"
    [dev]="${HOME}/Docmuments/Development"
    [node]="${HOME}/Documents/Development/Node"
    [java]="${HOME}/Documents/Development/Java"
    [python]="${HOME}/Documents/Development/Python"
    [school]="${HOME}/Documents/School"
    [iw]="${HOME}/Documents/School/IW"
    [bvp]="${HOME}/Documents/School/BvP"
)

# tp() {
#    cd ${beacons[$1]}
# }


export FFF_CD_ON_EXIT=1
alias f="fff"


# NNN Stuff

export NNN_USE_EDITOR=1
export NNN_DE_FILE_MANAGER=dolphin

export NNN_TMPFILE="/tmp/nnn"

n() {
    nnn "$@"

    if [ -f $NNN_TMPFILE ]; then
        . $NNN_TMPFILE
        rm $NNN_TMPFILE
    fi
}

nh() {
    NNN_SHOW_HIDDEN=1 n "$@"
}

export NNN_COPIER="echo -n $1 | xsel --clipboard --input"

# Python Virtualenv Stuff

export WORKON_HOME=~/Documents/Development/Python/virtualenvs
#source /usr/bin/virtualenvwrapper.sh

py() {
    PY_PREV_DIR=$PWD
    source "$1/bin/activate"
}

depy() {
    deactivate
    cd $PY_PREV_DIR
}

alias mkpy="python -m venv"


bindkey -v

HYPHEN_INSENSITIVE="true"
COMPLETION_WAITING_DOTS="true"

# Aliases

# Zsh
alias zshrc="vim ~/.zshrc"
alias reload="source ~/.zshrc"

# Yay
alias syu="yay -Syu"
alias s="yay -S $@"
alias r="yay -R $@"

# Code

c() {
    code $PWD &
}

# Git

alias ga="git add ."
alias gc="git commit -m"
alias gpsh="git push"
alias gpll="git pull"

gacp() {
    ga &&
    gc $1 &&
    gpsh
}

# Configs

alias polybarc="$EDITOR ~/.config/polybar/config"
alias i3c="$EDITOR ~/.config/i3/config"
alias termitec="$EDITOR ~/.config/termite/config"
alias rofic="$EDITOR ~/.config/rofi/config.rasi"

alias vi="vim"
alias v="vi"

# Scripts

alias rotate="~/.config/i3/rotate.sh"
alias tp='source tp'

alias ant="JAVA_HOME=/usr/lib/jvm/java-11-openjdk ant"


# /!\ do not use with zsh-autosuggestions

# /!\ zsh-syntax-highlighting and then zsh-autosuggestions must be at the end



#source /usr/share/nvm/init-nvm.sh
#source /usr/share/nvm/init-nvm.sh
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH

#export ZSH=/usr/share/oh-my-zsh


eval $(thefuck --alias)
alias config='/usr/bin/git --git-dir=/home/daan/.cfg/ --work-tree=/home/daan'
alias config='/usr/bin/git --git-dir=/home/daan/.cfg/ --work-tree=/home/daan'