alias -s txt='nano'
alias -s xz='tar -xvf'
alias -s gz='tar -xzvf'
alias -s tgz='tar -xzvf'
alias -s zip='unzip'
alias -s bz2='tar -xjvf'

alias cp='cp -i'
alias cl='clear'
alias ag='alias | grep'
alias hg='history | grep'

command_exists() { command -v "$@" >/dev/null 2>&1; }

if command_exists iptables; then
    alias ipl='sudo iptables -L -n'
    if [ -f "/etc/network/if-pre-up.d/iptables-load" ]; then
        alias ipe='sudo nano /etc/network/if-pre-up.d/iptables-load'
        alias ips='sudo /etc/network/if-pre-up.d/iptables-load'
    fi
fi

command_exists trash-put && alias rm='trash-put'
command_exists batcat && alias cat='batcat'
command_exists fdfind && alias fd='fdfind'

if command_exists eza; then
    alias e='eza -la'
    alias eb='eza -lab'
    alias et='eza -lT'
    alias ef='eza -lTa -BhHigSmu'
fi

command_exists docker && alias gost='docker run --rm -p 9443:9443 --cpus=0.2 --memory=256mb gogost/gost -L socks5://nano:QpuwAqcsP8Xp@:9443'

# functions from 20-function.zsh
alias ii='__zsh_get_ip'

# for Lazy
alias lazy='~/.lazy/run.sh'
