# navigation
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias ~='cd ~'

# shortcuts
alias d='du -h -d=1'
alias g='git'
alias history='history -E'
alias h='history'
alias ipt='iptables -L -n --line-numbers'
alias nginxtest='docker exec -it nginx nginx -t'
alias nginxreload='docker exec -it nginx /bin/bash -c "/usr/sbin/nginx -t && /usr/sbin/nginx -s reload"'

# defaults
alias df='df -h'

alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'


# Detect which `ls` flavor is in use
if ls --color > /dev/null 2>&1; then # GNU `ls`
	colorflag="--color"
else # OS X `ls`
	colorflag="-G"
fi

if [ -f /opt/homebrew/bin/eza ]; then
	alias ls='eza $eza_params'
	alias l='eza --git-ignore $eza_params'
	alias ll='eza --all --header --long $eza_params'
	alias llm='eza --all --header --long --sort=modified $eza_params'
	#alias la='eza -lbhHigUmuSa'
	alias la='eza -lbhHgma'
	alias lx='eza -lbhHigUmuSa@'
	alias lt='eza --tree $eza_params'
	alias tree='eza --tree $eza_params'
else
	alias la='ls -laF ${colorflag}'
	alias ls='ls -Fh ${colorflagI}'
fi

alias tmux='tmux -2'
alias view='vim -p -R'
alias vp='vim -p'
alias cat='bat'

alias tig='tig --all'
alias lgit='lazygit'
alias yy=yt-dlp
