-
Notifications
You must be signed in to change notification settings - Fork 0
/
.aliases
125 lines (112 loc) · 4.11 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/usr/bin/env bash
# Easier navigation: .., ..., ...., ....., ~ and -
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ~="cd ~" # `cd` is probably faster to type though
alias -- -="cd -"
# mv, rm, cp
alias mv='mv -v'
alias rm='rm -i -v'
alias cp='cp -v'
# ll
alias ll='ls -al'
# Directory Shortcuts
alias d="cd ~/Documents"
alias dl="cd ~/Downloads"
alias dt="cd ~/Desktop"
alias p="cd ~/Projects"
# NPM Shortcuts
alias n="$n"
# Replace with `@antfu/ni`
# alias ni="$n install"
# alias nt="$n test"
# alias nr="$n run"
# alias nx="$n dlx"
# alias nu="$n upgrade"
# alias nrm="$n remove"
# Proxy
alias ss="http_proxy=http://127.0.0.1:7890 https_proxy=http://127.0.0.1:7890"
alias ss-on="export http_proxy=http://127.0.0.1:7890;export https_proxy=http://127.0.0.1:7890;"
alias ss-off="unset http_proxy;unset https_proxy"
alias ss-edit="$EDITOR ~/.ShadowsocksX-NG/user-rule.txt"
alias brew="ss brew"
alias gh="ss gh"
# SSH
alias sshls="grep -E \"^Host ([^*]+)$\" $HOME/.ssh/config | sed 's/Host //'"
# Applications
alias wechatwebdevtools="/Applications/wechatwebdevtools.app/Contents/Resources/app.nw/bin/cli"
# Git
# refs:
# https://github.com/mathiasbynens/dotfiles/blob/main/.gitconfig
# https://github.com/Bash-it/bash-it/blob/master/aliases/available/git.aliases.bash
# https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/git/git.plugin.zsh
alias g='git'
alias ga='git add'
alias gaa='git add --all'
alias gsup='git branch --set-upstream-to=origin/`git branch --show-current`'
alias gb='git branch'
alias gba='git branch --all'
alias gbnm="git branch --no-merged"
alias gbr="git branch --remote"
alias gbm="git branch --move"
alias gbd='git branch --delete'
alias gbD='git branch -D' # Shortcut for --delete --force
alias gc='git commit -v'
alias gcx='gaa && git commit -m "x" && gpo'
alias gca='git commit -v -a'
alias gc!='git commit -v --amend'
alias gca!='git commit -v -a --amend'
alias gcam='git commit -v -a -m'
alias gcinit='git init && gaa && git commit -m "Initial commit"'
alias gco='git checkout'
alias gcb='git checkout -b'
alias gcm='git checkout main 2>/dev/null || git checkout master'
alias gcl='git clone --recurse-submodules'
alias gclean='git clean -fd'
alias gcp='git cherry-pick'
alias gcpx='git cherry-pick -x'
alias gd='git diff'
alias gds='git diff --staged'
alias gf='git fetch'
alias gfa='git fetch --all --prune --jobs=10'
alias glog='git log --oneline --decorate --graph'
alias glol="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'"
alias glols="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --stat"
alias glola="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --all"
alias glod="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset'"
alias glods="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --date=short"
alias gm='git merge'
alias gmv='git move'
alias grm='git rm'
alias gp='git push'
alias gpu='git push --set-upstream'
alias gpf!='git push --force'
alias gpo='git push origin `git branch --show-current`'
alias gl='git pull'
alias gr='git remote'
alias grv='git remote -v'
alias gra='git remote add'
alias grb='git rebase'
alias grbi='git rebase -i'
alias grbc='git rebase --continue'
alias gus='git reset HEAD'
alias gs='git status'
alias gst='git status'
alias gss='git status -s'
alias gsh='git show'
alias gt='git tag'
alias gsw='git switch'
alias gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "wip: xxx. [skip ci]"'
alias gwipm='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "wip: xxx. [skip ci]"; gc!'
alias todo="gh-todo"
# HBuilderX
alias hbuilderx='/Applications/HBuilderX.app/Contents/MacOS/cli'
# WeChat Devtools IDE
alias wechatdevtools='/Applications/wechatwebdevtools.app/Contents/MacOS/cli'
# httpstat
alias headers=httpstat
# Node.js CLI
alias npkill='npx npkill -s size'
alias kill-tabs='npx kill-tabs'