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

# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"

plugins=(git)
echo 'export PATH="/Applications/Sublime Text.app/Contents/SharedSupport/bin:$PATH"' >> ~/.zprofile

alias pip=pip3


__conda_setup="$('/Users/jlangr/opt/anaconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/Users/jlangr/opt/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/Users/jlangr/opt/anaconda3/etc/profile.d/conda.sh"
    else
        export PATH="/Users/jlangr/opt/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

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

prompt_context() {
  if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
    prompt_segment black default "%(!.%{%F{yellow}%}.)$USER"
  fi
}

# PS1="~ $: ";clear;


USER=``

# Path to your oh-my-zsh installation.
source ~/.oh-my-zsh/templates/zshrc.zsh-template

ZSH_THEME="agnoster"

plugins=(virtualenv git vscode tmux)

source $ZSH/oh-my-zsh.sh
export PATH=$HOME/.local/bin:$PATH

export BETTER_EXCEPTIONS=1

alias python=python3

# source activate b39

alias gs='watch -d -n .5 nvidia-smi'
alias psh='conda deactivate; pipenv shell'
alias psi=" conda deactivate && pipenv shell"
alias pll='pipenv install'
alias py='/miniconda3/envs/b37/bin/python'
alias gpureload="sudo rmmod nvidia_uvm ; sudo modprobe nvidia_uvm"
alias nbx='jupyter notebook'
alias cll='conda install'
#TODO: change
alias scl='f() { scp -i ~/.ssh/keys/project-lucas.pem $1 ubuntu@lucas-0${2}.love-lucas.com:/mnt/efs/ };f'
alias tnl='g() { ssh -L ${2:=8000}\:localhost:${3:=8888} ${1:=2-lucas} -fN}; g'
alias im2vid="f5() { ffmpeg -framerate 25 -pattern_type glob -i '*${1}.png' -c:v libx264 -r 30 -pix_fmt yuv420p ${1}.mp4 }; f5"
# ln -s /mnt/efs/datasets/drone_videos/pictures/*  trainA && ls -l trainA
alias symDir="f6() { for f in $(ls -d ${1}/*); do ln -s $f ${2}; done && ls -al ${2} }; f6 "
alias wh='f1() { tree . -f | grep ${1}}; f1'
alias we='f2() { env | grep ${1}}; f2'
alias lt='ls --human-readable --size -1 -S --classify'
alias gd='f3() {git diff HEAD~${1} HEAD~${2}}; f3'
# alias lt='du -sh * | sort -h'
# possible BT fix 
alias btfix='rm -rf ~/.config/pulse.old/ && mv ~/.config/pulse/ ~/.config/pulse.old/ && systemctl --user restart pulseaudio'
# docker images | awk '{print $3}' | head -n 20 | xargs docker rmi        
# (b39)  jakub@jl-rzr-21  ~  ssh cl-SW-interview "cat /home/ubuntu/cl-openpilot-gosia/gosia_diff.txt" | xclip -selection clipboard
# (b39)  jakub@jl-rzr-21  ~  ssh cl-SW-interview "cat /home/ubuntu/cl-openpilot-gosia/gosia_diff.txt" > ~/code/gosia_diff.txt   

bindkey -e
bindkey '^[[1;9C' forward-word
bindkey '^[[1;9D' backward-word
bindkey '^[[Z' up-line-or-search
bindkey "\e\e[D": backward-word
bindkey "\e\e[C": forward-word

# find devices
# sudo arp-scan --localnet
# ps aux | grep fastboot | awk '{print $2}' | head -n 2| xargs sudo kill
# route

alias python=python3

export PATH="/usr/local/opt/icu4c/bin:$PATH"
export PATH="/usr/local/opt/icu4c/sbin:$PATH"

export PATH=/usr/local/cuda-11.2/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-11.2/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export CUDA_HOME=/usr/local/cuda
export LD_LIBRARY_PATH=/home/jakub/code/cuda/lib64:$LD_LIBRARY_PATH
export PATH="/usr/local/include:${PATH}"
PATH=/bin:/usr/bin:/usr/local/bin:${PATH}

# do the following only if it was not set before
# hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000064,"HIDKeyboardModifierMappingDst":0x700000035}]}'