1
0
Fork 0
dotfiles/.config/zsh/configs/aliases

69 lines
1.9 KiB
Text
Raw Normal View History

2023-11-20 14:30:34 +01:00
# vim: set ft=sh:
# shellcheck disable=SC2142
2023-03-29 16:15:06 +02:00
# sudo not required for some system commands
2024-01-02 20:58:06 +01:00
for command in mount umount xbps-install xbps-remove apt aptitude updatedb su shutdown poweroff reboot; do
2024-01-02 19:03:09 +01:00
# shellcheck disable=SC2139
2024-01-02 19:02:59 +01:00
command -v $command 1>/dev/null 2>&1 && alias $command="sudo $command"
2023-03-29 16:15:06 +02:00
done
unset command
# Verbosity and settings that you pretty much just always are going to want.
alias \
2024-01-02 19:02:59 +01:00
vim="nvim" \
cp="cp -iv" \
mv="mv -iv" \
rm="rm -vI" \
bc="bc -ql" \
mkd="mkdir -pv" \
ffmpeg="ffmpeg -hide_banner" \
grep="grep --color=auto" \
diff="diff --color=auto" \
2024-01-02 19:03:09 +01:00
nvidia-settings="nvidia-settings --config=\$XDG_CONFIG_HOME/nvidia/settings" \
2024-01-02 19:02:59 +01:00
tldr="tldr -s"
2023-03-29 16:15:06 +02:00
# Colorize commands when possible.
alias \
2024-01-02 19:02:59 +01:00
ls="ls -hN --color=auto --group-directories-first" \
grep="grep --color=auto" \
diff="diff --color=auto" \
ccat="highlight --out-format=ansi" \
ip="ip -color=auto"
2023-03-29 16:15:06 +02:00
# These common commands are just too long! Abbreviate them.
alias \
2024-01-02 19:02:59 +01:00
ka="killall" \
2024-01-02 19:03:09 +01:00
e="\$EDITOR" \
2024-01-02 19:02:59 +01:00
z="zathura"
2023-03-29 16:15:06 +02:00
if command -v pacman 1>/dev/null 2>&1; then
2024-01-02 19:02:59 +01:00
alias p="pacman"
fi
if command -v apt 1>/dev/null 2>&1; then
alias \
ain="apt install" \
are="apt remove" \
arein="apt reinstall" \
aur="apt autoremove" \
aup="apt upgrade" \
2023-11-22 20:42:33 +01:00
ase="\\apt search" \
ash="apt show"
fi
if command -v xbps-install 1>/dev/null 2>&1; then
alias \
2024-01-02 19:02:59 +01:00
xin="xbps-install" \
xup="xbps-install -Syu" \
xre="xbps-remove" \
xse="xbps-query -Rs"
fi
2023-03-29 16:15:06 +02:00
# Misc.
alias \
2023-06-15 17:27:56 +02:00
ll="ls -lhpAN --color=auto --group-directories-first" \
2023-03-29 16:15:06 +02:00
xgetkeys="xev | sed -ne '/^KeyPress/,/^$/p'" \
2023-11-20 14:30:34 +01:00
whed='() { $EDITOR $(which "$1") }' \
2024-01-02 19:02:59 +01:00
xpick=" xprop | awk '
2023-03-29 16:15:06 +02:00
/^WM_CLASS/{sub(/.* =/, \"instance:\"); sub(/,/, \"\nclass:\"); print}
/^WM_NAME/{sub(/.* =/, \"title:\"); print}'"