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

54 lines
1.5 KiB
Bash

#!/bin/sh
# shellcheck disable=SC2142
# sudo not required for some system commands
for command in mount umount xbps-install xbps-remove updatedb su shutdown poweroff reboot; do
# shellcheck disable=SC2139
command -v $command 1>/dev/null 2>&1 && alias $command="sudo $command"
done
unset command
# Colorization
alias \
ls="ls --color=auto --group-directories-first" \
grep="grep --color=auto" \
diff="diff --color=auto" \
ccat="highlight --out-format=ansi" \
grep="grep --color=auto" \
diff="diff --color=auto" \
ip="ip -color=auto"
# Common flags
alias \
vim="nvim" \
cp="cp -iv" \
mv="mv -iv" \
rm="rm -vI" \
bc="bc -ql" \
mkd="mkdir -pv" \
tldr="tldr -s" \
ffmpeg="ffmpeg -hide_banner" \
nvidia-settings="nvidia-settings --config=\$XDG_CONFIG_HOME/nvidia/settings"
# Shortening
alias \
ka="killall" \
ll="ls -lhpAN --color=auto --group-directories-first" \
subup="git submodule update --remote --recursive --merge"
# Quasi functions
alias \
xgetkeys="xev | sed -ne '/^KeyPress/,/^$/p'" \
whed='() { $EDITOR $(which "$1") }' \
xpick="xprop | awk '
/^WM_CLASS/{sub(/.* =/, \"instance:\"); sub(/,/, \"\nclass:\"); print}
/^WM_NAME/{sub(/.* =/, \"title:\"); print}'"
# Void specific aliases
alias \
x="xbps-install" \
xr="xbps-remove" \
xsi="xpkg -a |\
fzf -m --preview 'xq {1} | \\grep -e pkgver -e license -e short_desc -e installed_size -e maintainer -e repository -e homepage' --preview-window=right:66%:wrap |\
xargs -ro xi"