blob: cfd909433cee3ea7f1b6781af97da274c8be55f3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# 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'
|