#!/bin/sh # Use neovim for vim if present. [ -x "$(command -v nvim)" ] && alias vim="nvim" vimdiff="nvim -d" [ -f "$MBSYNCRC" ] && alias mbsync="mbsync -c $MBSYNCRC" # doas not required for some system commands for command in mount umount dinitctl pacman updatedb su shutdown poweroff reboot ; do alias $command="doas $command" done; unset command se() { choice="$(fd . --base-directory=$HOME/.local/bin -t f --min-depth=1 | fzf)" [ -f "$HOME/.local/bin/$choice" ] && $EDITOR "$HOME/.local/bin/$choice" } # Verbosity and settings that you pretty much just always are going to want. alias \ cp="cp -iv" \ mv="mv -iv" \ rm="rm -vI" \ bc="bc -ql" \ rsync="rsync -vrPlu" \ mkd="mkdir -pv" \ yt="yt-dlp --embed-metadata -i" \ yta="yt -x -f bestaudio/best" \ ytt="yt --skip-download --write-thumbnail" \ ffmpeg="ffmpeg -hide_banner" # Colorize commands when possible. alias \ ll="eza -lh --group-directories-first --color=auto --color-scale=all --color-scale-mode=fixed --icons --no-quotes --smart-group -s size --total-size --no-user --no-permissions" \ ls="eza --group-directories-first --color=auto --icons --no-quotes -s name" \ lsf="eza -f --group-directories-first --color=auto --icons --no-quotes -s name" \ lsd="eza -D --group-directories-first --color=auto --icons --no-quotes -s name" \ lst="eza -lh --group-directories-first --color=auto --color-scale --icons --no-quotes --smart-group -s time --total-size --no-user --no-permissions" \ cat="bat -P" \ ccat="highlight --out-format=ansi" \ ip="ip -color=auto" # These common commands are just too long! Abbreviate them. alias \ cl="clear" \ ka="killall" \ trem="transmission-remote" \ YT="youtube-viewer" \ sdn="shutdown -h now" \ e="$EDITOR" \ v="$EDITOR" \ p="paru" \ z="zathura" \ lg="lazygit" \ sx="swayimg" \ md="monerod --prune-blockchain --fast-block-sync 1 --data-dir /mnt/ssd/monero/bitmonero" \ fetch="fastfetch --logo-color-2 default" \ de="doasedit" \ emg="doas emerge -avuDN @world" # Git related alias \ g="git" \ gs="git status --short" \ gd="git diff" \ ga="git add" \ gc="git commit" \ gp="git push" \ gu="git pull" \ gl="git log" \ gb="git branch" \ gi="git init" \ gcl="git clone" alias \ magit="nvim -c MagitOnly" \ ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc"