#!/bin/zsh
# configure aliases
#               _                     _
#              ( )                   (_ )  _
#   ____   ___ | |__   ______    _ _  | | (_)   _ _   ___    __    ___
#  (_  ,)/',__)|  _ `\(______) /'_` ) | | | | /'_` )/',__) /'__`\/',__)
#   /'/_ \__, \| | | |        ( (_| | | | | |( (_| |\__, \(  ___/\__, \
#  (____)(____/(_) (_)        `\__,_)(___)(_)`\__,_)(____/`\____)(____/


# clear the terminal
alias cl() {
  if [[ "$TMUX_PANE" ]]; then
    tmux send-keys -R\; clear-history
  else
    clear
  fi
}

# move into the ~/.dotfiles directory
alias cdots() { cd "${HOME}/.dotfiles" }

# move into zsh config files
alias zdots="vi ${ZDOTDIR}"

# open dotfiles in nvim editor
#alias dots="vi $DOTFILES"

# print the banner
#alias banner() { clear && cat < "$ZDOTDIR/banner" }

# create a directory and move into it.
#alias mkcd() { mkdir $1 && cd $1 }

# list files and directories, including hidden files
#alias l() { ls -lah --color "$@" }

# editor
alias vim() { nvim "$@" }
alias vi() { nvim "$@" }

# git
alias g() { git "$@" }
alias ga() { git add . }
alias gcb() { git checkout -b "$@" }
alias gco() { git checkout "$@" }
alias gl() { git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit }
alias gma() { git add . && git commit -m "$1" }
alias gp() { git push }
alias gs() { git status }

# move back to old cwd
alias bk="cd $OLDPWD"

# My mac-mini specific aliases
# if [ $(hostname -s) = "Michaels-Mac-mini" ]; then
#  alias projects() { cd "/Volumes/M1 Mac-Mini External Drive/Projects" }
# fi

# change file to be executable
#alias chmox() { chmod +x "$@" }

# tmux
#alias ta() { tmux -f ~/.config/tmux/tmux.config attach "$@" }

