-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
642 lines (536 loc) · 24 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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
# NOTE: ORDERING IS IMPORTANT.
# Package Managers must be on top. As those languages can be used in shell scripts.
# 1. ASDF
# 2. VOLTA
# 3. Brew
# USERNAME
# export USERNAME=apple
export TERM=xterm-256color
# GPG
export GPG_TTY=$(tty)
# export AWS_REGION=us-east-1
# export PATH=/Users/arpit/Library/Python/3.10/bin:$PATH
# cd ~/Blockfi/blockfi-mystique
#================================================================================
# Open file with nvim and goto line.
nl(){ IFS=: read -r f l <<< "$1"; nvim "$f" +"$l"; }
vimtoline(){ IFS=: read -r f l <<< "$1"; nvim "$f" +"$l"; }
#================================================================================
# ALSO - .zshenv is not a good place for setting PATH on macos. https://stackoverflow.com/questions/26433856/why-would-path-be-getting-overwritten-after-shell-login#comment69745215_26434096
#================================================================================
# ASDF - Start
#================================================================================
# . $(brew --prefix asdf)/asdf.sh # https://github.com/asdf-vm/asdf/issues/428
export PATH=~/language-servers/elixir-ls/rel:$PATH # Language Servers
export PATH=~/language-servers/lua-language-server/bin/macOS:$PATH
# . /usr/local/opt/asdf/asdf.sh # THIS IS MUCH FASTER THAN THE ABOVE -> . $(brew --prefix asdf)/asdf.sh
# . /usr/local/opt/asdf/libexec/asdf.sh
# . /opt/homebrew/bin/asdf
export PATH=$HOME/.asdf/shims:$PATH #https://github.com/asdf-vm/asdf/issues/107#issuecomment-257282018
#NOTE: asdf path should be first - i.e. before /user/local/bin and /usr/bin etc.
#Hence it's set before all. SEE: PATH - IMP Section
# the above function is also setting the asdf path but it will push below by /user/local/bin.
# That's why in PATH-IMP section we have explicitly set the PATH for asdf,volta,brew,make
# In General, language version managers like asdf, volta should be on top.
# Then brew(/user/local/bin) and then everything else.
# Note: later we have set android paths. I don't need java except for react-native yet.
# Hence I'm not installing java explicitly. We will rely on react-native's java guide.
# asdfreshim() {
# asdf reshim erlang elixir golang rust ruby java python
# }
asdfreshim(){
rm -rf ~/.asdf/shims; asdf reshim
}
#================================================================================
# ASDF - END
#================================================================================
#================================================================================
# PATH - IMP - Start
#================================================================================
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/.asdf/installs/elixir/1.12.0-rc.0-otp-23/.mix/escripts/:$PATH
export PATH=/usr/local/bin:$PATH #for homebrew
export PATH=/usr/local/sbin:$PATH #for homebrew
export PATH=/usr/local/opt/make/libexec/gnubin:$PATH #for make
export PATH=/usr/local/opt/grep/libexec/gnubin:$PATH #grep
export PATH=/usr/local/lib/luarocks/rocks-5.4/luaformatter/scm-1/bin:$PATH
export PATH=/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH
export PATH=${PATH//$(asdf where python)\/shims:/}
export PATH=~/language-servers/elixir-ls/rel:$PATH # Language Servers
export PATH=~/language-servers/lua-language-server/bin/macOS:$PATH
export PATH="/usr/local/opt/openssl@3/bin:$PATH"
export PATH="$HOME/.apollo/bin:$PATH"
#================================================================================
# PATH - IMP - End
#================================================================================
#================================================================================
# Android & Android Studio - Start
#================================================================================
export ANDROID_HOME=/Users/$USERNAME/Library/Android/sdk/
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
#================================================================================
# Android & Android Studio - End
#================================================================================
#================================================================================
# Tmux - Start
#================================================================================
alias ta="tmux attach"
alias tls="tmux ls"
alias tk="tmux kill-session -t"
alias ta0="tmux attach-session -t 0"
alias ta1="tmux attach-session -t 1"
alias ta2="tmux attach-session -t 2"
alias ta3="tmux attach-session -t 3"
alias ta4="tmux attach-session -t 4"
alias ta5="tmux attach-session -t 5"
alias x0="tmux attach-session -t 0"
alias tmono="tmux attach-session -t mono || tmx "
alias tm="tmono && cd ~/savi/mono"
alias tkm="tmux kill-session -t mono"
# alias tm= tmono || tmx
tmx () {
# Use -d to allow the rest of the function to run
tmux new-session -d -s mono -n 'iex' -c ~/Savi/mono/services 'make iex.server'
#tmux new-window -n iex -c ~/Savi/mono/services
# tmux send -d -t mono:iex 'make iex.server' Enter
# -d to prevent current window from changing
tmux new-window -d -n web -c ~/Savi/mono/web 'yarn start'
# tmux send -d -t mono:web 'yarn start' Enter
# tmux new-window -d -n Win3
# tmux new-window -d -n Win4
# -d to detach any other client (which there shouldn't be,
# since you just created the session).
# tmux attach-session -d -t mono
# tmux select-window -t e:1
cd ~/Savi/mono/
}
#================================================================================
# Tmux - End
#================================================================================
#================================================================================
# Zellij - End
#================================================================================
alias zls="zellij ls"
alias za="zellij attach"
alias zk="zellij kill-session"
alias zka="zellij kill-all-sessions"
alias zw="zellij attach mw || zellij -s mw --layout /Users/arpit/.config/zellij/mono-layout.kdl"
alias zm="zellij attach mono || zellij -s mono --layout /Users/arpit/.config/zellij/mono-layout.kdl"
alias zv="zellij attach vms || zellij -s vms --layout /Users/arpit/.config/zellij/vms-layout.kdl"
#================================================================================
# Zellij - End
#================================================================================
#================================================================================
# DOTFILE Management - Start
#================================================================================
# dot command should be before we use it in some function. (e.g. dotbrew)
# echo "alias dot='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'" >> ~/.zshrc
alias dot='/usr/bin/git --git-dir=/Users/$USERNAME/.dotfiles/ --work-tree=/Users/$USERNAME'
alias ds="dot status"
alias da="dot add"
alias dc="dot commit -m"
alias dp="dot push -u origin master"
alias drh="dot reset HEAD"
dopen() {
if [ $# -eq 0 ]; then
open https://github.com/collegeimprovements/dotfiles
else
open http://localhost:$1
fi
}
#================================================================================
# DOTFILE Management - End
#================================================================================
#================================================================================
# HomeBrew
#================================================================================
dotbrew() {
rm $HOME/macos/Brewfile
brew bundle dump --file=$HOME/macos/Brewfile
dot add $HOME/macos/Brewfile
dot add $HOME/.config/nvim
dot commit -m "updates brewfile and nvim"
}
updatebrew() {
# parallel brew ::: update upgrade
brew update
brew upgrade
echo "Brew updated and upgraded"
}
brewit() {
brew cleanup --prune 1
updatebrew
echo "brewed it - $(date)"
}
brewall() {
brewit
dotbrew
}
#================================================================================
# HomeBrew - END
#================================================================================
#================================================================================
# Antibody - Plugin Manager - START
#================================================================================
# source <(antibody init)
# source ~/.zsh_plugins.sh
# Update Zsh plugins
updatezsh() {
# antibody bundle <~/.zsh_plugins.txt >~/.zsh_plugins.sh
# antibody update
# zinit update --all
zinit update --parallel
source ~/.zshrc
}
#================================================================================
# Antibody - Plugin Manager - END
#================================================================================
#================================================================================
# rupa z - Start
#================================================================================
# z - frecency based cd
# . /usr/local/etc/profile.d/z.sh
#================================================================================
# rupa z - End
#================================================================================
#================================================================================
# FZF - Start
#================================================================================
export FZF_DEFAULT_COMMAND='rg --files'
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
#================================================================================
# FZF - End
#================================================================================
#================================================================================
# VSCODE - Start
#================================================================================
vscode-dump-extensions-list-to-file() {
code --list-extensions >~/.config/vscode/my-extensions.txt
}
vscode-install-extensions-from-file() {
# Non-Parallel version
# while read line; do code --install-extension "$line"; done < ~/.config/vscode/my-extensions.txt
# parallel version - doesn't work - improve later
# cat ~/.config/vscode/my-extensions.txt | xargs -n1 parallel code --install-extension
# the below one works great. TIL: xargs is not required here with parallel.
#working Parallel version
cat ~/.config/vscode/my-extensions.txt | parallel code --install-extension
vscode-dump-extensions-list-to-file
}
vscode-install-extension() {
if [ $# -eq 0 ]; then
echo "provide name of extension. Note: currently we just assume name is valid"
else
for word in "$@"; do
code --install-extension "$word"
echo "$word" >>~/.config/vscode/my-extensions.txt
done
vscode-dump-extensions-list-to-file
fi
}
alias vix="vscode-install-extension"
alias vd="vscode-dump-extensions-list-to-file"
alias vinstall="vscode-install-extension"
#================================================================================
# VSCODE - End
#================================================================================
#================================================================================
# ELIXIR - Start
#================================================================================
export ERL_AFLAGS="-kernel shell_history enabled"
export KERL_BUILD_DOCS="yes"
export KERL_CONFIGURE_OPTIONS="--without-wx --without-javac --with-ssl=$(brew --prefix openssl)"
export EGREP=egrep
export CPP="clang++ -E "
export CC=clang
# export KERL_CONFIGURE_OPTIONS="–disable-debug --without-javac"
#================================================================================
# ELIXIR - End
#================================================================================
#================================================================================
# fkill - Start
#================================================================================
fkill() {
lsof -ti:$1 | xargs kill -9
}
#================================================================================
# fkill - End
#================================================================================
#================================================================================
# PSQL - Start
#================================================================================
export PSQL_EDITOR="nvim"
#================================================================================
# PSQL - End
#================================================================================
#================================================================================
# COMMON ALIASES - Start
#================================================================================
# alias cls="printf '\033[2J\033[3J\033[1;1H'" # kitty - cmd+k - clears scrollback
alias ......="cd ../../../../.."
alias .....="cd ../../../.."
alias ....="cd ../../.."
alias ...="cd ../.."
alias ..="cd .."
alias 2.="cd ../.."
alias 3.="cd ../../.."
alias 4.="cd ../../../.."
alias 5.="cd ../../../../.."
alias ball="brewall"
alias bat="bat --theme ansi"
alias bl="~/Blockfi/blockfi-mystique"
alias bm="~/Blockfi/blockfi-mystique"
alias c="~/Savi/mono/services/apps/api/lib/api_web/live/frontend/events_live/ev/components/custom_components.ex"
alias ca="~/Projects/ZAKI/cloche_api"
alias cat="bat --theme ansi -p"
alias ce="code ~/.zshenv"
alias cl="~/Cookstro/cloche_api"
alias clo="~/Cookstro/cloche_api"
alias cls="printf '\e[3J'" # kitty - cmd+k - clears scrollback
alias cnz="code ~/.zshrc"
alias cz="code ~/.zshrc"
alias cze="code ~/.zshrc ~/.zshenv"
alias desk="cd ~/Desktop"
alias down="cd ~/Downloads"
alias u="cd ~/clsa/ultra"
alias a="cd ~/clsa/ultra-api"
alias e="~/Savi/mono/services/apps/api/lib/api_web/live/frontend/events_live/ev/index.ex"
alias infra="cd ~/Documents/projects/infrastructure"
alias l="exa -l"
alias la="exa -a"
alias lc="~/Cookstro/cloche_api"
alias ll="exa -lha"
alias ls="exa"
alias mn="~/savi/mono/"
alias mns="~/savi/mono/services/"
alias mono="~/savi/mono/services"
alias n="nvim"
alias nck="nvim ~/.config/kitty/custom-kitty.conf"
alias nz="nvim ~/.zshrc"
alias o="open ."
alias p="~/Documents/projects"
alias rr="rm -rf"
alias rt="rg --files | tree --fromfile"
alias si="source .in"
alias sz="source ~/.zshrc"
alias t1="tree -L 1"
alias t2="tree -L 2"
alias t3="tree -L 3"
alias t4="tree -L 4"
alias t=rt
alias ui="/Users/$USERNAME/Documents/projects/ultra-ui"
alias update-nvim-nightly='asdf uninstall neovim nightly && asdf install neovim nightly'
alias urm="command rm -i"
alias vi="nvim"
alias vim="nvim"
alias weather="curl wttr.in"
alias zrc="nvim ~/.zshrc"
alias ehd="export | grep HTTP && export | grep DB"
alias uhp="unset HTTPS_PROXY && unset HTTP_PROXY"
alias shp="export HTTP_PROXY=http://165.225.116.28:9400 && export HTTPS_PROXY=http://165.225.116.28:9400"
alias w="networksetup -setairportpower en0 on && networksetup -setnetworkserviceenabled 'Belkin USB-C LAN' off && git config --global user.email '[email protected]' && unset HTTP_PROXY && unset HTTPS_PROXY"
alias ww="networksetup -setairportpower en0 off && networksetup -setnetworkserviceenabled 'Belkin USB-C LAN' on && git config --global user.email '[email protected]' && export HTTP_PROXY=http://165.225.116.28:9400 && export HTTPS_PROXY=http://165.225.116.28:9400"
alias cn="ww"
alias cb='defbro $(defbro | grep -v "^\*" | grep "com.brave.Browser\|com.google.Chrome" | cut -d " " -f3)'
alias allowapp="sudo xattr -rd com.apple.quarantine"
#spelling mistakes
alias claer="clear"
alias cler="clear"
alias oepn="open"
alias breww="brew"
alias fomrat="format"
#suffix aliases
# alias -s {zip,ZIP}="unzip -l"
# alias -s {mp4,MP4,mov,MOV}="background vlc"
# alias -s html='brave'
alias -s {pdf,PDF}='preview'
alias -s {mp4,MP4,mov,MOV}='vlc'
alias -s {zip,ZIP}="unzip -l"
# alias -s {txt,css,js,mdx,md,ex,exs,jsx,zshrc,zsh_profile,json,xml}="code"
alias -s {txt,css,js,mdx,md,ex,exs,jsx,zshrc,zsh_profile,json,xml,yml,toml,yaml}="nvim"
# Git Aliases
alias lg="lazygit"
alias gopen="git-open"
alias ga="git add"
alias gc="git commit -m"
alias gp="git pull && git push"
alias gl="git pull"
alias grm="git rebase master"
alias gs="git status"
alias gd="git diff"
alias gco="git checkout"
alias gpo="git pull origin"
alias gpo="git pull origin master"
alias gpf="git pull && git fetch --prune"
alias gr='cd "$(git rev-parse --show-toplevel)"'
alias gm="git checkout master && git pull origin master && git checkout - && git rebase master"
# alias gm="git checkout master && git pull origin master && git push all master && gco rex"
# Elixir Aliases
alias m="mix ecto.migrations"
alias mr="mix ecto.rollback"
alias mm="mix ecto.migrate"
alias mg="mix deps.get"
alias mc="mix deps.compile"
alias mgc="mix deps.get && mix deps.compile && mix compile"
alias mh="mix hex.outdated"
alias mdu="mix deps.update --all "
alias mf="mix format"
alias ix="iex -S mix"
alias x="iex -S mix"
alias xp="gr && iex -S mix phx.server"
alias mt="MIX_ENV=test iex -S mix"
alias ips="iex -S mix phx.server"
alias lxp="MIX_ENV=local iex -S mix phx.server"
# alias ms="cd ~/Savi/mono/services && fkill 9001 && make iex.server"
alias mcs="cd ~/Savi/mono/services && fkill 9001 && make console.server"
alias ms="cd ~/Savi/mono/services && fkill 9001 && make console.server"
# ssh
alias cdev="ssh -i ~/Movies/devops.pem [email protected]"
alias cprod="ssh -i ~/Movies/devops.pem [email protected]"
alias hdev="ssh -i ~/Movies/devops.pem [email protected]"
alias hprod="ssh -i ~/Movies/devops.pem [email protected]"
# IP addresses - https://github.com/mathiasbynens/dotfiles/blob/master/.aliases
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
alias localip="ipconfig getifaddr en0"
alias ips="ifconfig -a | grep -o 'inet6\? \(addr:\)\?\s\?\(\(\([0-9]\+\.\)\{3\}[0-9]\+\)\|[a-fA-F0-9:]\+\)' | awk '{ sub(/inet6? (addr:)? ?/, \"\"); print }'"
# Show active network interfaces
alias ifactive="ifconfig | pcregrep -M -o '^[^\t:]+:([^\n]|\n\t)*status: active'"
# Recursively delete `.DS_Store` files
alias deleteDS_Stores="find . -type f -name '*.DS_Store' -ls -delete"
# Show/hide hidden files in Finder
alias show="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
alias hide="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"
# Hide/show all desktop icons (useful when presenting)
alias hidedesktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
alias showdesktop="defaults write com.apple.finder CreateDesktop -bool true && killall Finder"
#cal - show previous and future month as well
alias cal="cal -3"
alias att="almostontop toggle"
alias sl="sh ~/a.sh"
# currencyConverter - https://github.com/Rayrsn/currencyConverter
function ccd() { currencyConverter $1 usd inr}
#python
# alias python=python3
# alias pip=pip3
#================================================================================
# COMMON ALIASES - End
#================================================================================
# source /Users/arpit/Library/Preferences/org.dystroy.broot/launcher/bash/br
#================================================================================
# Useful Functions
# https://github.com/mdumitru/fancy-ctrl-z/blob/master/fancy-ctrl-z.zsh
#================================================================================
fancy-ctrl-z () {
if [[ $#BUFFER -eq 0 ]]; then
BUFFER="fg"
zle accept-line
else
zle push-input
zle clear-screen
fi
}
zle -N fancy-ctrl-z
bindkey '^Z' fancy-ctrl-z
# See details of what's running on a port
# Maybe you want to kill -9 the pid of it
# lsof -i :9001 -S
#================================================================================
# Python Related Things - CAPCHASE
#================================================================================
#================================================================================
# Kitty - Zsh - Cursor Shape should be blocked
#================================================================================
function zle-keymap-select zle-line-init zle-line-finish
{
case $KEYMAP in
vicmd) print -n '\033[1 q';; # block cursor -> '\033[1 q';;
viins|main) print -n '\033[1 q';; # line cursor -> '\033[5 q';;
esac
}
zle -N zle-line-init
zle -N zle-line-finish
zle -N zle-keymap-select
#================================================================================
#================================================================================
# EXAMPLES
#================================================================================
# rg 'ClocheApi' --files-with-matches | xargs sd -f c ClocheApi Cie
#================================================================================
#================================================================================
### Added by Zinit's installer
#================================================================================
if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then
print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f"
command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit"
command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \
print -P "%F{33} %F{34}Installation successful.%f%b" || \
print -P "%F{160} The clone has failed.%f%b"
fi
source "$HOME/.local/share/zinit/zinit.git/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
# Load a few important annexes, without Turbo
# (this is currently required for annexes)
zinit light-mode for \
zdharma-continuum/zinit-annex-as-monitor \
zdharma-continuum/zinit-annex-bin-gem-node \
zdharma-continuum/zinit-annex-patch-dl \
zdharma-continuum/zinit-annex-rust
### End of Zinit's installer chunk
#================================================================================
# MY ZSH PLUGINS (I used to use Antibody for this)
#================================================================================
zinit ice wait"2" lucid
zinit light zsh-users/zsh-autosuggestions
zinit ice wait"2" lucid
zinit light zsh-users/zsh-completions
zinit ice wait"2" lucid
zinit light zsh-users/zsh-history-substring-search
zinit ice wait"2" lucid
zinit light zsh-users/zsh-syntax-highlighting
zinit light zpm-zsh/autoenv
# denysdovhan/spaceship-prompt - another good shell.
zinit light subnixr/minimal # current shell - it's quite nice.
zinit ice wait"2" lucid
zinit light popstas/zsh-command-time
zinit ice wait"2" lucid
zinit light changyuheng/fz
zinit ice wait"2" lucid
zinit light rupa/z
zinit ice wait"2" lucid
zinit light caarlos0/zsh-mkc
zinit ice wait"2" lucid
zinit light mattmc3/zsh-safe-rm
# unixorn/tumult.plugin.zsh #https://github.com/unixorn/tumult.plugin.zsh -> For useful commands
# unixorn/tumult.plugin.zsh
zinit ice wait"2" lucid
zinit light MichaelAquilina/zsh-you-should-use
zinit ice wait"2" lucid
zinit light paulirish/git-open
#experimental
zinit ice wait"2" lucid
zinit light wfxr/forgit
zinit ice wait"2" lucid
zinit light Valiev/almostontop
# jeffreytse/zsh-vi-mode
#================================================================================
# . /usr/local/opt/asdf/libexec/asdf.sh
#=====================================SAVI========================================
eval "$(ssh-agent -s)" > /dev/null 2>&1
# mac
ssh-add --apple-use-keychain ~/.ssh/*.pem &>/dev/null
function setJump {
export JUMP_PUBLIC_IP=$(aws ec2 describe-instances --filters Name=tag:Name,Values=jump --region us-west-2 \
--query "Reservations[*].Instances[*].PublicIpAddress" --output=text)
export MIGRATION_PRIVATE_IP=$(aws ec2 describe-instances --filters Name=tag:Name,Values=migration-prod-v1 --region us-west-2 \
--query "Reservations[*].Instances[*].PrivateIpAddress" --output=text)
}
function sshReadReplica {
setJump
echo "Jump IP set, connecting to read replica"
ssh -N -L 5432:savi-mono-prod-read-replica.cuwk9myovve6.us-west-2.rds.amazonaws.com:5432 -J \
ubuntu@$JUMP_PUBLIC_IP "ec2-user@$MIGRATION_PRIVATE_IP" -i ~/.ssh/savi-us-west-2.pem
}
#=====================================SAVI========================================
# Created by `pipx` on 2023-02-25 20:41:17
export PATH="$PATH:/Users/arpit/.local/bin"