change aliases
This commit is contained in:
parent
7b4bbb15ba
commit
6840a9e1f0
1 changed files with 37 additions and 53 deletions
|
@ -1,68 +1,52 @@
|
||||||
# vim: set ft=sh:
|
# vim: set ft=sh:
|
||||||
# shellcheck disable=SC2142
|
# shellcheck disable=SC2142
|
||||||
# sudo not required for some system commands
|
# sudo not required for some system commands
|
||||||
for command in mount umount xbps-install xbps-remove apt aptitude updatedb su shutdown poweroff reboot; do
|
for command in mount umount xbps-install xbps-remove updatedb su shutdown poweroff reboot; do
|
||||||
# shellcheck disable=SC2139
|
# shellcheck disable=SC2139
|
||||||
command -v $command 1>/dev/null 2>&1 && alias $command="sudo $command"
|
command -v $command 1>/dev/null 2>&1 && alias $command="sudo $command"
|
||||||
done
|
done
|
||||||
unset command
|
unset command
|
||||||
|
|
||||||
# Verbosity and settings that you pretty much just always are going to want.
|
# Colorization
|
||||||
alias \
|
alias \
|
||||||
vim="nvim" \
|
ls="ls --color=auto --group-directories-first" \
|
||||||
cp="cp -iv" \
|
grep="grep --color=auto" \
|
||||||
mv="mv -iv" \
|
diff="diff --color=auto" \
|
||||||
rm="rm -vI" \
|
ccat="highlight --out-format=ansi" \
|
||||||
bc="bc -ql" \
|
grep="grep --color=auto" \
|
||||||
mkd="mkdir -pv" \
|
diff="diff --color=auto" \
|
||||||
ffmpeg="ffmpeg -hide_banner" \
|
ip="ip -color=auto"
|
||||||
grep="grep --color=auto" \
|
|
||||||
diff="diff --color=auto" \
|
|
||||||
nvidia-settings="nvidia-settings --config=\$XDG_CONFIG_HOME/nvidia/settings" \
|
|
||||||
tldr="tldr -s"
|
|
||||||
|
|
||||||
# Colorize commands when possible.
|
# Common flags
|
||||||
alias \
|
alias \
|
||||||
ls="ls -hN --color=auto --group-directories-first" \
|
vim="nvim" \
|
||||||
grep="grep --color=auto" \
|
cp="cp -iv" \
|
||||||
diff="diff --color=auto" \
|
mv="mv -iv" \
|
||||||
ccat="highlight --out-format=ansi" \
|
rm="rm -vI" \
|
||||||
ip="ip -color=auto"
|
bc="bc -ql" \
|
||||||
|
mkd="mkdir -pv" \
|
||||||
|
tldr="tldr -s" \
|
||||||
|
ffmpeg="ffmpeg -hide_banner" \
|
||||||
|
nvidia-settings="nvidia-settings --config=\$XDG_CONFIG_HOME/nvidia/settings"
|
||||||
|
|
||||||
# These common commands are just too long! Abbreviate them.
|
# Shortening
|
||||||
alias \
|
alias \
|
||||||
ka="killall" \
|
ka="killall" \
|
||||||
e="\$EDITOR" \
|
ll="ls -lhpAN --color=auto --group-directories-first"
|
||||||
z="zathura"
|
|
||||||
|
|
||||||
if command -v pacman 1>/dev/null 2>&1; then
|
# Quasi functions
|
||||||
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" \
|
|
||||||
ase="\\apt search" \
|
|
||||||
ash="apt show"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if command -v xbps-install 1>/dev/null 2>&1; then
|
|
||||||
alias \
|
|
||||||
xin="xbps-install" \
|
|
||||||
xup="xbps-install -Syu" \
|
|
||||||
xre="xbps-remove" \
|
|
||||||
xse="xbps-query -Rs"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Misc.
|
|
||||||
alias \
|
alias \
|
||||||
ll="ls -lhpAN --color=auto --group-directories-first" \
|
xgetkeys="xev | sed -ne '/^KeyPress/,/^$/p'" \
|
||||||
xgetkeys="xev | sed -ne '/^KeyPress/,/^$/p'" \
|
whed='() { $EDITOR $(which "$1") }' \
|
||||||
whed='() { $EDITOR $(which "$1") }' \
|
xpick="xprop | awk '
|
||||||
xpick=" xprop | awk '
|
|
||||||
/^WM_CLASS/{sub(/.* =/, \"instance:\"); sub(/,/, \"\nclass:\"); print}
|
/^WM_CLASS/{sub(/.* =/, \"instance:\"); sub(/,/, \"\nclass:\"); print}
|
||||||
/^WM_NAME/{sub(/.* =/, \"title:\"); print}'"
|
/^WM_NAME/{sub(/.* =/, \"title:\"); print}'"
|
||||||
|
|
||||||
|
# xbps package manager aliases
|
||||||
|
alias \
|
||||||
|
x="xbps-install" \
|
||||||
|
xr="xbps-remove" \
|
||||||
|
xsin="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"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue