# utils.zsh # Replacements for coreutils, color and reasonable defaults for common tools, etc. function has () { command -v "$@" &> /dev/null } alias dd="dd status=progress oflag=direct,sync" alias grep="grep -E --color=auto --exclude-dir=.git" # one day i will try ag or rg alias mkdir='mkdir -p' if [[ $OSTYPE =~ 'linux' ]]; then # probably breaks for busybox but i don't run alpine anywhere at the moment alias df="df -TH --exclude-type=tmpfs --exclude-type=devtmpfs --exclude-type=squashfs --exclude-type=udev" alias diff='diff --color' alias ls='ls --color=auto' alias ll='ls -l --almost-all --no-group --human-readable --color=auto' elif [[ $OSTYPE =~ 'darwin' ]]; then alias df="df -YH -T noautofs,devfs,tmpfs,squashfs" alias ls='ls -G' alias ll='ls -hoAG' elif [[ $OSTYPE == 'cygwin' ]]; then alias sudo='cygstart --action=runas' fi if has eza; then alias ls='eza' alias ll='eza --long --header --all' fi has bat && alias cat='bat --plain --paging=never' # another for --show-all (and --number on base cat)? has gpg2 && alias gpg='gpg2' has tree && alias tree='tree -C'