-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
181 lines (149 loc) · 4.32 KB
/
.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
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
#!/usr/bin/env sh
# Config.
exit_code=0
cgreen="\033[0;32m"
creset="\033[0m"
# Simple console logger.
log_info() {
printf "[${cgreen}d info${creset} ] %s\n" "$1"
}
# End info. End early, gracefully.
end_info() {
log_info 'Done.'
log_info 'End .zshrc.'
return "$exit_code"
}
# Begin info.
log_info 'Begin .zshrc.'
# Oh my zsh.
. "$HOME/.oh-my-zsh/oh-my-zsh.sh"
# Things we don't want to commit.
. "$HOME/.envrc"
# Misc.
alias la='ls -alh'
alias df='df -h'
# git.
alias g='git'
alias glod='git log --graph --pretty='\''%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset'\'
alias glog="git log --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative"
alias gp='git pull'
alias ga='git add'
alias gc='git commit'
alias gca='git commit -a'
alias gco='git checkout'
alias gcb='git copy-branch-name'
alias gb='git branch'
alias gs='git status -sb'
alias gac='git add -A && git commit -m'
alias ge='git-edit-new'
# Python.
# alias p='python'
# Node.js.
alias n='node'
# npm.
alias npmi='npm install'
alias npmc='npm ci'
alias npml='npm run lint'
alias npmt='npm run test'
alias npmb='npm run build'
# Playwright.
alias pw='playwright'
alias pwui='playwright test --ui'
alias pwt='playwright test'
alias pwth='playwright test --headed'
alias pwcg='playwright codegen'
# vscode.
alias c='code'
# nvm.
alias n14='nvm use 14'
alias n16='nvm use 16'
alias n18='nvm use 18'
alias n20='nvm use 20'
alias n22='nvm use 22'
# AWS CLI.
alias a='aws'
alias asl='aws sso login'
# kubectl.
alias k='kubectl'
alias kcu='kubectl config use-context'
alias kcg='kubectl config get-contexts'
alias kgp='kubectl get pods --all-namespaces=false'
alias kgpa='kubectl get pods --all-namespaces=true'
alias ke='kubectl exec --stdin=true --tty=true --container'
# helm.
alias h='helm'
# ArgoCD.
alias acd='argocd'
# Argo Workflows.
alias aw='argo'
# Podman/Docker.
alias p='podman'
alias pr='podman run'
alias pd='podman pull'
alias pe='podman exec'
alias pey='podman exec --interactive --tty'
alias pp='podman pod'
alias d='docker'
alias dco='docker compose'
alias dr='docker run'
alias dritd='docker run --interactive --tty --detach'
alias dp='docker pull'
alias de='docker exec'
alias deit='docker exec --interactve --tty'
export DOCKER_HOST='unix:///var/folders/vk/_vtj8q6n1h113g0vf5yt3b9h0000gq/T/podman/podman001-api.sock'
# Jira.
alias j='jira'
# Github.
alias ghc='gh copilot'
# macOS specific.
if [ "$(uname)" = 'Darwin' ]; then
# Hide/show all desktop icons.
alias hidedesktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
alias showdesktop="defaults write com.apple.finder CreateDesktop -bool true && killall Finder"
# Open apps.
alias chrome="open -a google\ chrome"
alias chromed="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222"
alias firefox="open -a firefox"
alias safari="open -a safari"
alias preview="open -a preview"
alias slack="open -a Slack"
alias mute="osascript -e 'set volume output muted true'"
alias unmute="osascript -e 'set volume output volume 75'"
# Lock screen.
alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend"
alias wifion="networksetup -setairportpower en0 on"
alias wifioff="networksetup -setairportpower en0 off"
fi
#
# Remove node_modules.
#
rmn() {
log_info 'Removing node_modules.'
if [ -d node_modules ]; then
time rm -rf node_modules
if [ "$?" -eq 0 ]; then
log_info 'Done.'
else
log_info 'Failed.'
fi
else
log_info 'node_modules not found. That is OK.'
fi
}
# pyenv.
eval "$(pyenv init --path)"
# direnv.
# Silent.
export DIRENV_LOG_FORMAT=
eval "$(direnv hook zsh)"
# nvm.
[ -s "$HOME"/.nvm/nvm.sh ] && . "$HOME"/.nvm/nvm.sh
[ -s "$HOME"/.nvm/bash_completetion ] && . "$HOME"/.nvm/bash_completion
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# .NET
export DOTNET_ROOT="/usr/local/opt/dotnet/libexec"
export MONO_GAC_PREFIX="/usr/local"
# kind.
export KIND_EXPERIMENTAL_PROVIDER=podman
# End info.
end_info