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

export TELEPORT_PROXY=teleport.aws.neon.tech

alias res="clear && ls"
alias celar="clear"
alias eee="clear"
alias killtimes="python3 ~/Desktop/notes/notime.py "
export GIT_EDITOR=vim

alias compile_drawio="python3 $HOME/dropbox/forfun/notes/latexDocs/compile_drawio.py"

alias concatpdfs="python3 ~/dropbox/forfun/notes/latexDocs/concatpdfs.py"

export PATH=$PATH:/usr/local/go/bin
export PATH=$PATH:/usr/lib/julia-1.8.1/bin
export PATH=$PATH:$HOME/.local/bin

# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
# ZSH_THEME="af-magic"
# ZSH_THEME="fishy"
ZSH_THEME="clean"
# ZSH_THEME="candy"

# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"

# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
HYPHEN_INSENSITIVE="true"

# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
plugins=(
	wd
  git
  z
)

# aliases
alias goo="brave-browser"
alias brave="google-chrome"
alias killsnap="snap-store --quit ; sudo snap refresh "
alias sz="source ~/.zshrc"
alias oa="evince *.pdf"
alias pypy="~/pypy/bin/pypy "
# alias pypypip="/usr/local/bin/pypy/bin/./pip "
alias gcco="gcc -std=c++11 -O3 -march=native -funroll-loops "
alias vi="nvim"
alias mouse='python3 $BASE/forfun/functions/mouseMover.py'
alias l='ls'
alias ltex='find *.tex'
alias lt='ls *.tex'
alias lh='echo "running python server at localhost:8000"; python3 -m http.server'
alias gitc='git add .;  git commit -m'
alias gitu='git pull origin master'
alias gitp='git push origin master'
alias gitph='git push heroku master'
alias journal='pandoc --css style.css -s --mathjax -H custom_header.html readme.md -o index.html'
alias backup='sh $BASE/forfun/miscProgramming/functions/rsync_all.sh'
alias sl='ls'
alias gl="git -c color.ui=auto log --graph --pretty=tformat:'%C(yellow)%h%Creset}%Cgreen(%ar)%Creset}%C(bold blue)<%an>%Creset} %s' -100|  column -s '}' -t | less"
alias cppLineCount="( find . -name '*.cpp' -print0 | xargs -0 cat ) | wc -l"
alias hppLineCount="( find . -name '*.hpp' -print0 | xargs -0 cat ) | wc -l"
alias cleanDS="sudo find . -name '.DS_Store' -type f -delete"
alias ctstex="latexmk -pvc -view='pdf' "

alias cvenv="python3 -m virtualenv venv"
alias vact="source venv/bin/activate" # activate a virtual env

alias dumbjavac="/usr/lib/jvm/java-8-openjdk-amd64/bin/javac"
alias dumbjava="/usr/lib/jvm/java-8-openjdk-amd64/bin/java"
export JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk-amd64"

alias lu='sudo brightnessctl -d "intel_backlight" set +5%'
alias ld='sudo brightnessctl -d "intel_backlight" set 5%-'

export SKYSPACE="/home/alek/Dropbox (MIT)/skyspace"
export BASE="/home/alek/dropbox"
alias bsky='python3 $SKYSPACE/compile.py; python3 $SKYSPACE/compile-feeds.py; cd $SKYSPACE; git add .; git commit -m "new post"; git push'
alias csky='python3 $SKYSPACE/compile.py; python3 $SKYSPACE/compile-feeds.py'
alias textoaugmd='python3 $SKYSPACE/tex_to_augmd.py '
alias newcatsky="python3 $SKYSPACE/create_category.py"

# bash scripts

gitsetremote(){
	if [ -z "$1" ]
	then 
		echo "you forgot the name of the repo."
	else
    git remote set-url origin git@github.com:awestover/$1.git
  fi
}

rmd() {
  pandoc $1 | lynx -stdin
}

mkcdir() {
	mkdir $1
	cd $1
}

pandapdf() {
  fullname=$1
  filename=${fullname%.md}
  echo $filename
	pandoc $filename.md -s -o $filename.pdf
}

minipandapdf(){
  fullname=$1
  filename=${fullname%.md}
  echo $filename
	pandoc $filename.md -s -V geometry:margin=.5in -V fontsize=10pt -o $filename.pdf
}

hw() {
	if [ -z "$1" ]
	then 
		echo "what should I name the homework?"
	else
		mkdir "./$1"
		cd "./$1"
		cp "$BASE/forfun/notes/latexDocs/head.tex" "."
		cp "$BASE/forfun/notes/latexDocs/homework.tex" "./$1.tex"
	fi
}

writeup() {
	if [ -z "$1" ]
	then 
		echo "what should I name the writeup?"
	else
		mkdir "./$1"
		cd "./$1"
		cp "$BASE/forfun/notes/latexDocs/head.tex" "."
		cp "$BASE/forfun/notes/latexDocs/writeup.tex" "./$1.tex"
	fi
}

notes() {
	if [ -z "$1" ]
	then 
		echo "put a project name plz"
	else
		mkdir "./$1"
		cd "./$1"
		cp "$BASE/forfun/notes/latexDocs/notes.tex" "./$1.tex"
	fi
}


vit() {
  latexmk -pdf -pvc $1 &>/dev/null &
  vi $1
}
kv(){
  kill $(ps aux | grep 'latexmk' | awk '{print $2}')
  latexmk -C
}

sky(){
  python3 $SKYSPACE/newfeed.py
  echo "sleeping..."
  sleep 0.5
  cd "$(cat $SKYSPACE/.most_recent_feed_dir.txt)"
  vi "$(cat $SKYSPACE/.most_recent_feed.txt)"
}

op(){
  for file in ./*.pdf; do open "${file}"; done
}

opng(){
  for file in ./*.png; do open "${file}"; done
}

myip() {
  ifconfig wlp0s20f3 | awk '$1 == "inet" {print $2}'
}

py() {
  if [ -z "$1" ]
  then 
    python3
  else
    python3 "$1"
  fi
}

eatself() {
  python3 /home/alek/dropbox/forfun/notes/terminalDocs/linuxDocs/eatself.py
  cd ..

}

wlog() {
  file_name="/home/alek/Desktop/PROGRESS.md"
  current_date=$(date +"%m/%d")
  existing_content=$(cat "$file_name" 2>/dev/null)
  echo -e "$current_date\n$existing_content" > "$file_name"
  vi "$file_name"
}

source $ZSH/oh-my-zsh.sh

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
