Repository navigation
Expand file tree
/
Copy pathdot_aliases
More file actions
50 lines (43 loc) · 1.73 KB
/
Copy pathdot_aliases
File metadata and controls
50 lines (43 loc) · 1.73 KB
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
eza_options='--links --git --group --changed --time-style long-iso --icons'
# Replace ls with eza, but only when eza is actually present. Shadowing a core
# command unconditionally means a missing or unlinked Homebrew tool takes out
# `ls` itself, in every shell that sources this file.
if command -v eza >/dev/null 2>&1; then
alias ls='eza $(printf $eza_options)'
alias tree='eza --tree $(printf $eza_options)'
fi
# Homebrew stuffs
alias update="brew update"
alias upgrade="brew upgrade"
alias cleanup="brew cleanup"
alias install="brew install"
alias doctor="echo '\nDoctor? Doctor who?\n' && brew doctor"
alias uud="update; upgrade; cleanup; doctor"
alias ood="uud"
# Utility commands (mostly from https://news.ycombinator.com/item?id=9869231)
alias o='open'
alias q='exit'
alias c='clear'
# Search process by name and highlight
function psgrep() { ps axu | grep -v grep | grep "$@" -i --color=auto; }
# Same guard as above: keep the real command when the replacement is missing.
command -v dust >/dev/null 2>&1 && alias du='dust'
command -v duf >/dev/null 2>&1 && alias df='duf'
command -v curlie >/dev/null 2>&1 && alias curl='curlie'
command -v bat >/dev/null 2>&1 && alias cat='bat -P'
command -v batdiff >/dev/null 2>&1 && alias diff='batdiff'
if command -v bat >/dev/null 2>&1; then
alias bathelp='bat --plain --language=help'
help() { "$@" --help 2>&1 | bathelp; }
else
help() { "$@" --help 2>&1 | less -R; }
fi
command -v btm >/dev/null 2>&1 && alias top='btm -b'
if [[ $OSTYPE == 'darwin'* ]]; then
#icloud drive
alias icloud='cd ~/Library/Mobile\ Documents/com\~apple\~CloudDocs/'
fi
alias k='kubectl'
alias root='cd $(git rev-parse --show-toplevel || echo ".")'
alias '?'='gh copilot explain'
alias '??'='gh copilot suggest'