-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
56 lines (44 loc) · 1014 Bytes
/
.zshrc
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
#############
# aliases
#############
alias gitacp=git_add_commit_push
alias gitbd=git_branch_delete
alias gitf="git fetch --prune"
alias ghrv="gh repo view --web"
alias ghrc="gh repo create --web"
alias ghpr="gh pr create --web"
#############
# functions
#############
# git add/commit/push
git_add_commit_push() {
set -x
git add .
git commit -m "$*"
git push
set +x
}
# git branch delete
git_branch_delete() {
git checkout main
git pull
pruned=$(git fetch --prune 2>&1)
branches=(${(f)"$(
echo "$pruned" |
grep '\[deleted\]' |
awk '{print $5}' |
sed 's|^origin/||'
)"})
for branch in $branches; do
git branch -D $branch
done
}
#############
# paths
#############
# homebrew
export PATH=$PATH:/opt/homebrew/bin
# nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion