-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaliases
105 lines (103 loc) · 3.6 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
95
96
97
98
99
100
101
102
103
104
#!/usr/bin/env zsh
# profile self update
alias update_profile="git -C $SHA1N_PROFILE_HOME pull --recurse-submodules origin $(git -C $SHA1N_PROFILE_HOME branch --show-current)"
alias reload!='source $HOME/.zshrc'
#
# directory shortcuts
#
alias home='cd $HOME'
alias back='cd $OLDPWD'
alias cod='cd $HOME/code'
alias cow='cd $HOME/code/w'
alias gos='cd $(go env GOPATH)/src/github.com/sha1n'
# main task conventions
alias main='cd -P $HOME/main'
#
# command shortcuts
#
alias cdz='cd $(dirname $(fzf --height 50%))'
alias vim='nvim'
alias vimz='vim -o $(fzf -m --height 50%)'
alias vimd='vim -d $(fzf -m --height 50%)'
alias grep='grep --color=always'
# ls
alias ll='ls -lh'
alias la='ls -lha'
# git
alias master='git checkout master'
alias status='git status'
alias reset='git reset'
alias add='git add'
alias commit='git commit'
alias stash='git stash'
alias pop='git stash pop'
alias gil='git log --abbrev=8 --pretty=format:"%C(red)%as%C(reset) %C(green)%h%C(reset)%C(auto)%d%C(reset) %s - %C(cyan)[%ce]%C(reset)"'
alias pull='git pull --autostash origin $(git branch --show-current)'
alias pull_master='git pull --rebase --autostash origin master'
alias pullmr='git pull --recurse-submodules origin master'
alias push='git push origin $(git branch --show-current)'
alias branch='git branch'
alias checkout='git checkout'
alias gc_branches='git branch | grep -v "^* $(git branch --show-current)$" | xargs git branch -D'
# gh
alias pr='gh pr create'
alias prs='gh pr list'
alias myprs='gh pr list -A sha1n'
alias issues='gh issue list'
alias releases='gh release list'
alias clone='gh repo clone'
alias rview='gh repo view -w'
# glab
alias gpr='glab mr create'
alias gprs='glab mr list'
alias gmyprs='glab mr list --author sha1n'
alias gissues='glab issue list'
alias greleases='glab release list'
alias gclone='glab repo clone'
alias grview='glab repo view -w'
# make
alias maket='make test'
alias makev='make format lint test'
# yarn/npm
alias yi='yarn install'
alias yt='y run test'
alias yit='y run test:it'
alias yut='y run test:unit'
alias yb='y run build'
alias yc='y run clean'
alias yl='yarn run lint'
alias yr='yi && yc && yb'
alias rm_node_modules='find . -type d -name node_modules -exec rm -rf {} +'
# vagrant
alias vu='vagrant up'
alias vh='vagrant halt'
# docker
alias dcc='docker kill $(docker ps -q) && docker rm -vf $(docker ps -qa)'
alias dvm='source dvm.sh'
# kubectl
alias k='kubectl'
alias ke='kubectl get events --sort-by=".lastTimestamp"'
alias kenn='kubectl get events --sort-by=".lastTimestamp" --field-selector type!=Normal'
alias kc='kubectl --kubeconfig'
# bazel
alias bazel='bazel_with_disk_cache_guard'
alias bazel_rm='sudo rm -rf ~/.cache/bazel'
# dockerized mysql
alias mysqld8=docker run -v "$HOME/mysql_mount/":/var/lib/mymysql -e MYSQL_ALLOW_EMPTY_PASSWORD=1 -p 3306:3306 mysql:8 --secure-file-priv=''
# maven
alias mvnf='mvn -U clean install'
alias mvnci='mvn clean install'
alias mvnq='mvn -T 1C clean install -DskipTests'
alias mvndt='mvn dependency:tree'
alias mvndr='mvn dependency:resolve -U'
alias mvndpl='mvn dependency:purge-local-repository -DsnapshotsOnly=true'
alias mvndplq='mvn dependency:purge-local-repository -DsnapshotsOnly=true -DactTransitively=false'
alias mvndpla='mvn dependency:purge-local-repository'
# filters out non first degree dependencies from 'mvndt' output
alias mvndtt='mvndt | grep --color=never -F "[INFO] +- " | tr -d "[INFO] +- "'
# utilities
alias uuid="uuidgen | awk '{print tolower(\$0)}'"
alias history='history 1'
alias diff='diff --side-by-side --suppress-common-lines'
# backup
alias backup="rsync -a --delete --delete-during -P --force --exclude=\".*\" \"$BACKUP_SRC_PATH\" \"$BACKUP_DST_PATH\""