-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
211 lines (171 loc) · 6.82 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# Path to your oh-my-zsh installation.
export ZSH=~/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="rafiki"
# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
HIST_STAMPS="yyyy-mm-dd"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git z zsh-autosuggestions)
source $ZSH/oh-my-zsh.sh
# Preferred editor all sessions
export EDITOR='vim'
# ssh
export SSH_KEY_PATH="~/.ssh/"
# zsh-syntax-highlighting
if [ -f /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]; then
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
fi
# .aliases
if [ -f ~/.aliases ]; then
source ~/.aliases
fi
# .functions
if [ -f ~/.functions ]; then
source ~/.functions
fi
export PATH="/usr/local/sbin:$PATH"
export PATH="/Applications/MacPorts/Emacs.app/Contents/MacOS:$PATH"
export PATH="~/.emacs.d/bin:$PATH"
# JAVASCRIPT
## NVM
## https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/etc/bash_completion.d/nvm" ] && \. "$NVM_DIR/etc/bash_completion.d/nvm" # This loads nvm bash_completion
if nvm --version &>/dev/null; then
# place this after nvm initialization!
autoload -U add-zsh-hook
load-nvmrc() {
local node_version="$(nvm version)"
local nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
if [ "$nvmrc_node_version" = "N/A" ]; then
nvm install
elif [ "$nvmrc_node_version" != "$node_version" ]; then
nvm use
fi
elif [ "$node_version" != "$(nvm version default)" ]; then
echo "Reverting to nvm default version"
nvm use default
fi
}
echo "Node version: $(node -v)"
echo "\tCMDs: nvm (ls|ls-remote) | nvm install (<version>|--lts) | nvm use (node|--lts|--lts=<LTS name>) | node -v"
add-zsh-hook chpwd load-nvmrc
load-nvmrc
fi
## YARN
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
# PYTHON
export PATH="/usr/local/opt/python/libexec/bin:$PATH"
## PYENV
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
echo "Python version: $(pyenv version)"
echo "\tCMDs: pyenv install (-l) | pyenv version(s) | pyenv (global|local) <version> | python --version"
fi
## Virtualenv
## Precursor: brew install virtualenvwrapper
## Comment the next 6 lines if using pipenv
if virtualenv --help &>/dev/null; then
export WORKON_HOME=$HOME/.envs
export PROJECT_HOME=$HOME/Projects/MD
export VIRTUALENVWRAPPER_PYTHON=$(which python3)
source /opt/homebrew/bin/virtualenvwrapper.sh
echo "\tvirtualenvwrapper is available - mkvirtualenv|workon|deactivate"
fi
## PIPX
## To activate completions in zsh, first make sure compinit is marked for
## autoload and run autoload then enable completions for pipx
if pipx --help &>/dev/null; then
autoload -U compinit && compinit
eval "$(register-python-argcomplete pipx)"
echo "\tpipx is available"
export PATH="$PATH:/Users/stanmd/.local/bin"
fi
# RUBY
## RBENV
## Precursor: brew install rbenv ruby-build
if [ -d "/opt/homebrew/opt/rbenv/bin" ]; then
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init - zsh)"
echo "Ruby version: $(rbenv global)"
echo "\tCMDs: rbenv install (-l|<version>) | rbenv global <version>"
fi
## Rust
. "$HOME/.cargo/env"
# JAVA
# Context: https://docs.oracle.com/en/java/javase/20/install/installation-jdk-macos.html
# Download link: https://www.oracle.com/java/technologies/downloads/ - Get the ARM64 DMG Installer
alias javalts='export JAVA_HOME=$(/usr/libexec/java_home)'
alias java23='export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-23.jdk/Contents/Home'
alias java21='export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-21.jdk/Contents/Home' # 21 is now the latest LTS of Java SE
# alias java8='export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_311.jdk/Contents/Home'
# java8 only works for x86_64 architecture
# GROOVY
export GROOVY_HOME=/opt/homebrew/opt/groovy/libexec
export PATH="/opt/homebrew/opt/groovy/bin:$PATH"
# KOTLIN
export PATH="/opt/homebrew/opt/kotlin/bin:$PATH"
# ANDROID
export ANDROID_SDK_ROOT="$HOME/Library/Android/Sdk"
export ANDROID_HOME="$HOME/Library/Android/Sdk"
PATH=$PATH:$ANDROID_SDK_ROOT/tools
PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
# GOLANG
# https://go.dev/doc/install OR via brew
# Typically, this is not necessary because Installer and Homebrew sets it up correctly
# If brew and when needed uncomment the lines below to set up the GOROOT environment variable
# if command -v go &>/dev/null; then
# export GOROOT=$(brew --prefix go)/libexec
# export PATH=$PATH:$GOROOT/bin
# fi
## GCLOUD
## JRNL
setopt HIST_IGNORE_SPACE
alias jrnl=" jrnl"
alias jj=" jrnl jot"
## GPG
export GPG_TTY=$(tty)
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
## Brew
export HOMEBREW_GITHUB_API_TOKEN=
# pnpm
export PNPM_HOME="/Users/stanmd/Library/pnpm"
case ":$PATH:" in
*":$PNPM_HOME:"*) ;;
*) export PATH="$PNPM_HOME:$PATH" ;;
esac
# pnpm end
# Load Angular CLI autocompletion.
# source <(ng completion script)
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/Users/stanmd/Downloads/google-cloud-sdk/path.zsh.inc' ]; then . '/Users/stanmd/Downloads/google-cloud-sdk/path.zsh.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/Users/stanmd/Downloads/google-cloud-sdk/completion.zsh.inc' ]; then . '/Users/stanmd/Downloads/google-cloud-sdk/completion.zsh.inc'; fi
# add fastlane
PATH=$PATH:$HOME/.fastlane/bin
# bun completions
[ -s "/Users/stanmd/.bun/_bun" ] && source "/Users/stanmd/.bun/_bun"
# bun
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
[ ! -f "$HOME/.x-cmd.root/X" ] || . "$HOME/.x-cmd.root/X" # boot up x-cmd.