aliasrc (2450B)
1 #!/bin/sh 2 3 # Use neovim for vim if present. 4 [ -x "$(command -v nvim)" ] && alias vim="nvim" vimdiff="nvim -d" 5 6 [ -f "$MBSYNCRC" ] && alias mbsync="mbsync -c $MBSYNCRC" 7 8 # doas not required for some system commands 9 for command in mount umount dinitctl pacman updatedb su shutdown poweroff reboot ; do 10 alias $command="doas $command" 11 done; unset command 12 13 se() { 14 choice="$(fd . --base-directory=$HOME/.local/bin -t f --min-depth=1 | fzf)" 15 [ -f "$HOME/.local/bin/$choice" ] && $EDITOR "$HOME/.local/bin/$choice" 16 } 17 18 # Verbosity and settings that you pretty much just always are going to want. 19 alias \ 20 cp="cp -iv" \ 21 mv="mv -iv" \ 22 rm="rm -vI" \ 23 bc="bc -ql" \ 24 rsync="rsync -vrPlu" \ 25 mkd="mkdir -pv" \ 26 yt="yt-dlp --embed-metadata -i" \ 27 yta="yt -x -f bestaudio/best" \ 28 ytt="yt --skip-download --write-thumbnail" \ 29 ffmpeg="ffmpeg -hide_banner" 30 31 # Colorize commands when possible. 32 alias \ 33 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" \ 34 ls="eza --group-directories-first --color=auto --icons --no-quotes -s name" \ 35 lsf="eza -f --group-directories-first --color=auto --icons --no-quotes -s name" \ 36 lsd="eza -D --group-directories-first --color=auto --icons --no-quotes -s name" \ 37 lst="eza -lh --group-directories-first --color=auto --color-scale --icons --no-quotes --smart-group -s time --total-size --no-user --no-permissions" \ 38 cat="bat -P" \ 39 ccat="highlight --out-format=ansi" \ 40 ip="ip -color=auto" 41 42 # These common commands are just too long! Abbreviate them. 43 alias \ 44 cl="clear" \ 45 ka="killall" \ 46 trem="transmission-remote" \ 47 YT="youtube-viewer" \ 48 sdn="shutdown -h now" \ 49 e="$EDITOR" \ 50 v="$EDITOR" \ 51 p="paru" \ 52 z="zathura" \ 53 lg="lazygit" \ 54 sx="swayimg" \ 55 md="monerod --prune-blockchain --fast-block-sync 1 --data-dir /mnt/ssd/monero/bitmonero" \ 56 fetch="fastfetch" \ 57 de="doasedit" 58 59 # Git related 60 alias \ 61 g="git" \ 62 gs="git status --short" \ 63 gd="git diff" \ 64 ga="git add" \ 65 gc="git commit" \ 66 gp="git push" \ 67 gu="git pull" \ 68 gl="git log" \ 69 gb="git branch" \ 70 gi="git init" \ 71 gcl="git clone" 72 73 alias \ 74 magit="nvim -c MagitOnly" \ 75 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"