-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.aliases
80 lines (67 loc) · 1.85 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
74
75
76
77
78
79
80
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
alias psync='rsync -avh --info=progress2'
alias paths='echo -e ${PATH//:/\\n}'
# ls specific with exa extra love
if [ -x "$(command -v exa)" ]; then
alias ls='exa'
alias tree='exa --tree --level=5'
alias lsf='exa -1'
alias lst='exa -FlTh --level=5'
alias lss='exa -FlTh --level=5 --no-permissions --no-user'
fi
alias l='ls -lbFh'
alias ll='ls -lah'
alias llm='ll --sort=modified'
# git specific
if [ -x "$(command -v git)" ]; then
alias gs='git status'
alias gss='git status -s'
alias gp='git push'
alias gpl='git pull'
alias gclean='git clean -fd'
alias gpristine='git reset --hard && git clean -dfx'
alias gexport='git archive --format zip --output'
alias gsubu='git submodule update --init --recursive'
alias gl='git log --graph --decorate --pretty=oneline --abbrev-commit'
if [ -x "$(command -v batcat)" ]; then
batdiff() {
git diff --name-only --relative --diff-filter=d | xargs batcat --diff
}
elif [ -x "$(command -v bat)" ]; then
batdiff() {
git diff --name-only --relative --diff-filter=d | xargs bat --diff
}
fi
fi
if [ -x "$(command -v ollama)" ]; then
alias ollama_update='ollama list | awk '\''NR>1 {system("ollama pull " $1)}'\'''
fi
if [ -x "$(command -v scp)" ]; then
alias scpp="scp -o PreferredAuthentications=password"
fi
if [ -x "$(command -v dig)" ]; then
# network
alias myip="dig +short myip.opendns.com @resolver1.opendns.com"
fi
if [ -x "$(command -v python3)" ]; then
# serve files via python
alias pyserve='python3 -m http.server'
fi
if [[ "$OSTYPE" =~ ^linux ]]; then
if [ -f ~/.aliases-linux ]; then
. ~/.aliases-linux
fi
fi
if [[ "$OSTYPE" =~ ^darwin ]]; then
if [ -f ~/.aliases-macos ]; then
. ~/.aliases-macos
fi
fi
if [[ "$OSTYPE" =~ ^msys ]]; then
if [ -f ~/.aliases-win ]; then
. ~/.aliases-win
fi
fi