config/.config/shell/aliasrc
2023-07-18 11:39:30 +09:30

76 lines
1.9 KiB
Bash

#!/bin/sh
# 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" \
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"
calsync="CALCURSE_CALDAV_PASSWORD=$(pass show calcurse) calcurse-caldav"
# 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"