# ~/.aliases

alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias less='less --use-color'
alias diff='delta -s --color-only'
alias hexedit='hexedit --color'
alias ip='ip --color'

# ls aliases
alias ls="eza -ho --time-style='+%Y-%m-%d %H:%M' --icons --git"
alias l='ls -h'
alias lSd='ls -Dl --total-size --git-repos'
alias la='ls -ah'
alias ll='ls -lh'
alias llsd='ls -Dl --git-repos'
alias lsa='ls -lah'
alias lsd='ls -D --git-repos'
alias lsf='ls -fhF'
alias lt='ls --tree'

# handy system cmds
alias cd='z'
alias cp='nocorrect cp -i'
alias md='mkdir -p'
alias mkdir='nocorrect mkdir'
alias mv='nocorrect mv -i'
alias rd='rmdir'
alias rm='rm -i'
alias df='duf -hide special'
alias rmhost='ssh-keygen -f ~/.ssh/known_hosts -R'
alias ssha='eval $(ssh-agent) && ssh-add'

# command replacements
alias cat='bat --paging=never --style=plain'
alias pcat='bat --paging=auto --style=auto'

# todo.txt
alias t='todo.sh -aP@'

# Arch
alias yay='nocorrect yay --color=auto'
alias pacman='nocorrect pacman'

# Ubuntu
alias age='sudo apt'
alias agi='sudo apt install'
alias agr='sudo apt remove'
alias agu='sudo apt update'
alias agud='sudo apt update && sudo apt dist-upgrade'
alias agug='sudo apt upgrade'
alias aguu='sudo apt update && sudo apt upgrade'

# systemd
alias scstart='sudo systemctl start'
alias scstop='sudo systemctl stop'
alias scs='systemctl status'
alias screstart='sudo systemctl restart'
alias screload='sudo systemctl reload'
alias scdr='sudo systemctl daemon-reload'
alias scenable='sudo systemctl enable'
alias scdisable='sudo systemctl disable'

# nocorrect
alias man='nocorrect man'
alias su='nocorrect su'
alias sudo='nocorrect sudo'

# fzf
alias fkill='fzf-kill'

# git
alias g='git'
alias ga='git add'
alias gaa='git add --all'
alias gb='git branch'
alias gbd='git branch --delete'
alias gc='git commit'
alias gcm='git commit -m'
alias gco='git checkout'
alias gcv='git commit --verbose'
alias gcvm='git commit --verbose -m'
alias gd='git diff'
alias gdca='git diff --cached'
alias gds='git diff --staged'
alias gdup='git diff @{upstream}'
alias gf='git fetch'
alias gfo='git fetch origin'
alias gl='git pull'
alias gls='git ls-files'
alias glg='git log --graph --decorate'
alias glgs='git log --stat --graph --decorate'
alias glgso='git log --oneline --stat --graph --decorate'
alias glog='git log --oneline --graph --decorate'
alias gm='git merge'
alias gmv='git mv'
alias gma='git merge --abort'
alias gmc='git merge --continue'
alias gmff='git merge --ff-only'
alias gp='git push'
alias gpd='git push --dry-run'
alias gpr='git pull --rebase'
alias gr='git remote'
alias grb='git rebase'
alias grba='git rebase --abort'
alias grbc='git rebase --continue'
alias grbi='git rebase --interactive'
alias grm='git rm'
alias grmc='git rm --cached'
alias grs='git restore'
alias grset='git remote set-url'
alias grst='git restore --staged'
alias grup='git remote update'
alias grv='git remote --verbose'
alias gsb='git status --short --branch'
alias gss='git status --short'
alias gst='git status'
alias gsta='git stash push'
alias gstall='git stash --all'
alias gstd='git stash drop'
alias gstl='git stash list'
alias gstp='git stash pop'
alias gsw='git switch'
alias gswc='git switch -c'
alias gswm='git switch $(git_main_branch)'

# yadm
alias y='yadm'
alias ya='yadm add'
alias yaa='yadm add --all'
alias yb='yadm branch'
alias ybd='yadm branch --delete'
alias yc='yadm commit'
alias ycm='yadm commit -m'
alias yco='yadm checkout'
alias yd='yadm diff'
alias ydc='yadm decrypt'
alias ycv='yadm commit --verbose'
alias ycvm='yadm commit --verbose -m'
alias ydca='yadm diff --cached'
alias yds='yadm diff --staged'
alias ydup='yadm diff @{upstream}'
alias yf='yadm fetch'
alias yfo='yadm fetch origin'
alias yl='yadm pull'
alias yls='yadm ls-files'
alias ylg='yadm log --graph --decorate'
alias ylgs='yadm log --stat --graph --decorate'
alias ylgso='yadm log --oneline --stat --graph --decorate'
alias ylog='yadm log --oneline --graph --decorate'
alias ym='yadm merge'
alias ymv='yadm mv'
alias yma='yadm merge --abort'
alias ymc='yadm merge --continue'
alias ymff='yadm merge --ff-only'
alias ync='yadm encrypt'
alias yp='yadm push'
alias ypd='yadm push --dry-run'
alias ypr='yadm pull --rebase'
alias yr='yadm remote'
alias yrb='yadm rebase'
alias yrba='yadm rebase --abort'
alias yrbc='yadm rebase --continue'
alias yrbi='yadm rebase --interactive'
alias yrm='yadm rm'
alias yrmc='yadm rm --cached'
alias yrs='yadm restore'
alias yrset='yadm remote set-url'
alias yrst='yadm restore --staged'
alias yrup='yadm remote update'
alias yrv='yadm remote --verbose'
alias ysb='yadm status --short --branch'
alias yss='yadm status --short'
alias yst='yadm status'
alias ysta='yadm stash push'
alias ystall='yadm stash --all'
alias ystd='yadm stash drop'
alias ystl='yadm stash list'
alias ystp='yadm stash pop'
alias ysw='yadm switch'
alias yswc='yadm switch -c'
alias yswm='yadm switch main'
alias yswd='yadm switch dev'

# ansible
alias a='ansible'
alias ap='ansible-playbook'
alias al='ansible-pull'
alias avc='ansible-vault create'
alias ave='ansible-vault edit'
alias avr='ansible-vault rekey'
alias avenc='ansible-vault encrypt'
alias avdec='ansible-vault decrypt'
alias avv='ansible-vault view'
alias aga='ansible-galaxy'
alias agad='ansible-galaxy delete'
alias agai='ansible-galaxy install'
alias agaim='ansible-galaxy import'
alias againf='ansible-galaxy info'
alias agal='ansible-galaxy list'
alias agalog='ansible-galaxy login'
alias agar='ansible-galaxy remove'
alias agas='ansible-galaxy search'

# LazyGit (yadm)
alias lazyy='lazygit -ucd ~/.local/share/yadm/lazygit -w ~ -g ~/.local/share/yadm/repo.git'

# tmux
alias ta='tmux attach'
alias tkill='tmux kill-server'
alias tks='tmux kill-session -t'
alias tls='tmux list-sessions'
alias tmv='tmux rename -t'
alias tns='tmux new -s'

# SSH
alias ssh='ssh -o AddKeysToAgent=yes'

# Caffeinate (MacOS)
alias caf='caffeinate -dims'
alias caffproc='caffeinate -dims -w'
