dotfiles

Torpy's handcrafted dootfiles.
Log | Files | Refs | README

aliasrc (1934B)


      1 #!/bin/sh
      2 
      3 # Use neovim for vim if present.
      4 [ -x "$(command -v nvim)" ] && alias vim="nvim" vimdiff="nvim -d"
      5 
      6 # Use $XINITRC variable if file exists.
      7 [ -f "$XINITRC" ] && alias startx="startx $XINITRC"
      8 
      9 [ -f "$MBSYNCRC" ] && alias mbsync="mbsync -c $MBSYNCRC"
     10 
     11 # doas not required for some system commands
     12 for command in mount umount sv pacman updatedb su shutdown poweroff reboot ; do
     13 	alias $command="doas $command"
     14 done; unset command
     15 
     16 se() {
     17 	choice="$(find ~/.local/bin -mindepth 1 -printf '%P\n' | fzf)"
     18 	[ -f "$HOME/.local/bin/$choice" ] && $EDITOR "$HOME/.local/bin/$choice"
     19 	}
     20 
     21 # Verbosity and settings that you pretty much just always are going to want.
     22 alias \
     23 	cp="cp -iv" \
     24 	mv="mv -iv" \
     25 	rm="rm -vI" \
     26 	bc="bc -ql" \
     27 	rsync="rsync -vrPlu" \
     28 	mkdir="mkdir -pv" \
     29 	yt="yt-dlp --embed-metadata -i" \
     30 	yta="yt -x -f bestaudio/best" \
     31 	ytt="yt --skip-download --write-thumbnail" \
     32 	ffmpeg="ffmpeg -hide_banner" \
     33 	hibernate="echo disk | doas tee /sys/power/state" \
     34 	profanity="proxychains4 profanity" \
     35 	sudo="doas" \
     36 	paint="mtpaint"	
     37 
     38 # Colorize commands when possible.
     39 alias \
     40 	ls="ls -hN --color=auto --group-directories-first" \
     41 	grep="grep --color=auto" \
     42 	diff="diff --color=auto" \
     43 	ccat="highlight --out-format=ansi" \
     44 	ip="ip -color=auto"
     45 
     46 # These common commands are just too long! Abbreviate them.
     47 alias \
     48 	ka="killall" \
     49 	g="git" \
     50 	trem="transmission-remote" \
     51 	ytd="yt-dlp" \
     52 	sdn="shutdown -h now" \
     53 	e="$EDITOR" \
     54 	v="$EDITOR" \
     55 	p="pacman" \
     56 	xi="doas xbps-install" \
     57 	xr="doas xbps-remove -R" \
     58 	xq="xbps-query" \
     59 	z="zathura" \
     60 	pipe="pipe-viewer" \
     61 	gpipe="gtk-pipe-viewer"
     62 
     63 alias \
     64 	lf="lfub" \
     65 	magit="nvim -c MagitOnly" \
     66 	ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutenvrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc"
     67 	config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'