config/.config/shell/aliasrc
2025-12-16 11:13:59 +00:00

96 lines
2.3 KiB
Bash

#!/bin/sh -x
# Use $XINITRC variable if file exists.
[ -f "$XINITRC" ] && alias startx="startx $XINITRC"
# sudo not required for some system commands
for command in mount umount pacman su shutdown poweroff reboot ; do
alias $command="sudo $command"
done; unset command
# 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" \
mkd="mkdir -pv" \
ffmpeg="ffmpeg -hide_banner" \
# Colorize commands when possible.
alias \
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" \
alias \
l="ls" \
ll="ls -l" \
lsa="ls -la" \
# These common commands are just too long! Abbreviate them.
alias \
ka="killall" \
g="git" \
e="$EDITOR" \
v="$EDITOR" \
v2="$EDITOR_SECONDARY" \
z="zathura"
alias \
magit="nvim -c MagitOnly" \
ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" \
# Alias dotfiles/config related commands
alias \
config="/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME" \
ccam="config commit -am" \
cpush="config push" \
cpull="config pull" \
cst="config status" \
# Alias tmux commands for ease of use
alias \
tmn="tmux new" \
tma="tmux-worker" \
tms="tmux-sessioniser" \
# Alias some extra things for ease of use
alias \
myip="curl api.ipify.org" \
cls="clear" \
c="clear" \
cdc="cd && clear" \
\?="duck" \
# git aliases
alias \
gst="git status" \
ga.="git add ." \
gca="git commit -a" \
gcam="git commit -am" \
gsta="git stash" \
gstac="git stash clear" \
gstaa="git stash apply" \
# drawterm
alias \
dtl="drawterm -u solomon -h central -a central" \
dtr="drawterm -u solomon -h inkletblot.com -a inkletbltot.com" \
alias \
calcurse="calcurse-select" \
alias \
usta="systemctl --user start" \
usto="systemctl --user stop" \
ures="systemctl --user restart" \
ustatus="systemctl --user status" \
ureload="systemctl --user daemon-reload" \
ucat="systemctl --user cat" \
utimer="systemctl --user list-timers" \
usvc="systemctl --user --type=service" \