-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaliases
73 lines (67 loc) · 1.49 KB
/
aliases
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# shellcheck shell=sh
# vi:et lbr noet sw=2 ts=2 tw=79 wrap
# Copyright 2019-2024 David Rabkin
# Checks whether all commands exits.
cmd_exists() {
command -v "$1" >/dev/null 2>&1
}
alias vi=vim
if cmd_exists vivid; then
LS_COLORS="$(vivid generate solarized-light)"
export LS_COLORS
fi
if cmd_exists eza; then
# The order is important.
# shellcheck disable=SC2262 # Can't be defined.
alias ls=eza\ --group-directories-first
alias l='ls --classify --grid --long'
else
# Detects which `ls` flavor is in use.
if ls --color >/dev/null 2>&1; then # GNU `ls`
colorflag=--color
else # OS X `ls`
colorflag=-G
fi
# The order is important.
# shellcheck disable=SC2139
alias ls="ls $colorflag"
alias l=ls\ -lFh
fi
alias la=l\ -a
if cmd_exists bat; then
alias cat=bat\ --style=plain
fi
# Always enables colored `grep` output.
alias grep=grep\ --color=auto
alias h=history
alias untar=tar\ -zxvf
alias ipe=curl\ ipinfo.io/ip
alias c=clear
# shellcheck disable=SC2139
alias src-tmux="tmux source-file $HOME/.tmux.conf"
# shellcheck disable=SC2139
alias src="source $HOME/.zshrc"
alias rsync='\
rsync \
--human-readable \
--progress \
--recursive \
--timeout=60 \
--verbose\
'
alias cmatrix='cmatrix -a -b -u 6 -C blue'
if cmd_exists brew; then
alias bu='\
brew update && \
brew upgrade && \
brew upgrade --cask --greedy && \
brew cleanup\
'
fi
if cmd_exists bfs; then
alias find=bfs
fi
if cmd_exists python3; then
# shellcheck disable=SC2139 # This expands when defined.
alias python="$(which python3)"
fi