💾 Archived View for ait.place › dot › shell › aliasrc.txt captured on 2023-01-29 at 03:42:35.

View Raw

More Information

⬅️ Previous capture (2022-07-16)

🚧 View Differences

-=-=-=-=-=-=-

#!/bin/sh

# Use neovim for vim if present.
[ -x "$(command -v nvim)" ] && alias vim="nvim" vimdiff="nvim -d"

# Use $XINITRC variable if file exists.
[ -f "$XINITRC" ] && alias startx="startx $XINITRC"

# sudo not required for some system commands
for x in mount umount pacman updatedb ; do
	alias $x="sudo $x"
done

# 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" \
	yt="youtube-dl --add-metadata -i" \
	yta="yt -x -f bestaudio/best" \
	ffmpeg="ffmpeg -hide_banner"

# Colorize commands when possible.
alias \
	ls="ls -hNX --color=auto" \
	grep="grep --color=auto" \
	diff="diff --color=auto" \
	ip="ip -c=auto" \
	ccat="highlight --out-format=ansi"

# These common commands are just too long! Abbreviate them.
alias \
	ka="killall" \
	g="git" \
	la="ls -A" \
	ll="ls -lA" \
	trem="transmission-remote" \
	r="tuir -s" \
	lsf="r livestreamfail" \
	sdn="sudo shutdown -h now" \
	cdp="cd -P"
	f="$FILE" \
	e="$EDITOR" \
	v="$EDITOR" \
	z="zathura" \
	p="sudo pacman" \
	SS="sudo systemctl"

# Some other stuff
alias \
	vigit="nvim -c Neogit" \
	tmux="tmux -f $XDG_CONFIG_HOME/tmux/tmux.conf" \
	doom="doom --doomdir $XDG_CONFIG_HOME/doom" \
	sloccount="sloccount --datadir $XDG_CACHE_HOME/sloccount" \
	abook="abook --config "$XDG_CONFIG_HOME"/abook/abookrc --datafile "$XDG_DATA_HOME"/abook/addressbook" \

vic() { file="$(which $*)" && $EDITOR $file || echo "$file"; }
mpva() { mpv --ytdl-format=bestaudio --force-window=no ytdl://ytsearch:"$*"; }
mpvv() { mpv ytdl://ytsearch:"$*"; }