#!/usr/share/env bash

# Aliases I like
alias :q="exit"
alias :wq="exit"
alias sourcerc="source ~/.bashrc"
alias c="clear"
alias shutdown="systemctl poweroff"
alias update-grub="sudo grub-mkconfig -o /etc/grub2-efi.cfg"
alias nvidia-smi-docker='sudo docker run --rm --gpus all --privileged nvidia/cuda:12.8.1-base-ubuntu24.04 nvidia-smi'
alias ncconnect='sudo docker exec -u www-data -it nextcloud-aio-nextcloud bash'
alias avante='nvim -c "lua vim.defer_fn(function()require(\"avante.api\").zen_mode()end, 100)"'
alias nlc='nvim leetcode.nvim'
alias clauded='claude --allow-dangerously-skip-permissions'
alias claudedr='claude --allow-dangerously-skip-permissions --resume'
alias commit-repo='git add -A && git commit -m "Update stuff" && git push'

# Docker Shortcuts
alias docker-up='sudo docker compose up -d'
alias docker-down='sudo docker compose down'
alias docker-stop='sudo docker compose stop'
alias docker-update='sudo docker compose down && sudo docker compose up -d'
alias docker-restart='sudo docker compose restart'

# Finger Print
alias fprint-on='sudo authselect enable-feature with-fingerprint'
alias fprint-off='sudo authselect disable-feature with-fingerprint'

# File system
alias ls='eza -lh --group-directories-first --icons'
alias lsa='ls -a'
alias lt='eza --tree --level=2 --long --icons --git'
alias lta='lt -a'
# Fedora's bat installs /usr/bin/bat; batcat is the Debian name.
alias ff="fzf --preview 'bat --style=numbers --color=always {}'"

# Directories
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'

# Tools
alias vim='vimx'
alias n='nvim'
alias n.="nvim ."
alias ns="nvim src"
alias nlc="nvim lc"
alias watchsmi="watch -n 1 nvidia-smi"
alias watchamdsmi="watch -n 1 rocm-smi"

# Compression
compress() { tar -czf "${1%/}.tar.gz" "${1%/}"; }
alias decompress="tar -xzf"
