config/.config/shell/aliasrc

67 lines
1.6 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 \
lf="lfub" \
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" \
tm.="tmux-sessioniser ."
# Alias some extra things for ease of use
alias \
myip="curl api.ipify.org" \
cls="clear" \
c="clear" \
cdc="cd && clear"