-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaliases
94 lines (73 loc) · 2.72 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Detect which `ls` flavor is in use
if [ "$(uname)" = "Darwin" ]; then
args="-G" # OS X `ls
else
args="--color --group-directories-first --sort=extension" # GNU `ls`
fi
alias l="ls -lhAF ${args}"
alias lh="history | tail"
alias v='vim'
alias vd='vimdiff'
alias vp='vim -p'
alias rm="rm -i" #safety trigger
alias cd-="cd -" #typos
# tmux stuff
alias t='tmux'
alias tl='tmux ls'
alias ta='tmux a -t'
alias tra='tmux attach-session -dt' # refreshes buffer
alias tns='tmux new -s'
# python
alias p='python3'
alias pf='pip3 freeze'
alias va='source venv/bin/activate'
alias vn='python3 -m venv venv'
alias ea='source env/bin/activate'
alias en='python3 -m venv env'
alias pa='pyenv activate'
alias pd='pyenv deactivate'
alias pv='pyenv virtualenv'
# tox
alias tx='tox --skip-pkg-install'
# Git stuff
alias gs='git status'
alias gcm='git commit -m'
alias gc='git checkout'
alias gp='git push origin master'
alias gpu='git pull origin master'
alias gsp='git submodule foreach git pull origin master'
alias ga='git add'
alias gsm='git checkout master && gpu && gfe --prune'
alias grs='git reset HEAD~1 --soft'
alias gbm='git branch --merged master'
alias gfe='git fetch --all --prune'
alias gpc='git push -u origin $(git rev-parse --abbrev-ref HEAD)'
alias gpcf='gpc --force-with-lease'
alias gd='git difftool --extcmd "vimdiff --noplugin"'
alias gdc='git d --cached --diff-filter=M'
alias gdm='git pretty-diff `git merge-base master $(git rev-parse --abbrev-ref HEAD)`..$(git rev-parse --abbrev-ref HEAD); $BROWSER `wslpath -a -w /tmp/diff.html`'
alias glg="git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)'"
alias glga="glg --all"
alias glg2="git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset)%C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset)'"
alias glg2a="glg2 --all"
alias ..="cd .."
alias ..2="cd ../.."
alias ..3="cd ../../.."
alias ..4="cd ../../../.."
alias k="kubectl"
alias e="explorer.exe ."
# easy htop filter
alias hk='htop -u `whoami`'
# Recursively delete `.DS_Store` files
alias cleanup_dsstore="find . -name '*.DS_Store' -type f -ls -delete"
# Recursively delete python caches
alias cleanup_py="find . -type f -iname '*.pyc' -o -iname '*.pyo' -exec rm -rv {} + && find . -type d -name '__pycache__' -exec rm -rv {} +"
# tree
alias tree='tree -C --dirsfirst -I "__pycache__"'
alias chmox='chmod -x'
# macOS has no `md5sum`, so use `md5` as a fallback
command -v md5sum > /dev/null || alias md5sum="md5"
# Update all
alias brewall='brew update \
&& brew upgrade \
&& brew cleanup'