-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc
183 lines (119 loc) · 4.55 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
# ----------------------------------- ENV -----------------------------------
# Path to your oh-my-zsh installation.
export ZSH="/Users/aadeshchandra/.oh-my-zsh"
# default to dev aws profile
export AWS_PROFILE=dev-sso-profile
export SSH_KEY_PATH="~/.ssh"
# sublime as default editor
export EDITOR='subl -w'
# ----------------------------------- ZSH -----------------------------------
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
# ZSH_THEME="spaceship"
# ----------------------------------- SOURCE -----------------------------------
source $HOME/.cargo/env
source $ZSH/oh-my-zsh.sh
# ----------------------------------- PATH -----------------------------------
# go binary
export PATH=/usr/local/go/bin:$PATH
# deno binary
export PATH=$HOME/.deno/bin:$PATH
# mysql binary
export PATH=/usr/local/mysql/bin:$PATH
# Volta binary
export VOLTA_HOME="$HOME/.volta"
export PATH="$VOLTA_HOME/bin:$PATH"
# sublime
export PATH="/Applications/Sublime Text.app/Contents/SharedSupport/bin:$PATH"
# brew
export PATH=/opt/homebrew/bin:$PATH
#postgres
export PATH=/Library/PostgreSQL/15/bin:$PATH
export PGCONFIG=/Library/PostgreSQL/15/bin/pg_config
export PGUSER=postgres
export PGDATA=/Library/PostgreSQL/15/data
export PATH=/usr/local/bin:$PATH
export PATH="$HOME/.local/bin:$PATH"
# pnpm
export PNPM_HOME="/Users/aadeshchandra/Library/pnpm"
export PATH="$PNPM_HOME:$PATH"
# Bun
export BUN_INSTALL="/Users/aadeshchandra/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
# export PATH=/Users/aadeshchandra/.local/bin:$PATH
# ----------------------------------- ALIAS -----------------------------------
alias git-graph="git log --all --decorate --oneline --graph"
alias git-yeet="git reset --hard HEAD && git clean -fd"
alias ls="lsd"
alias cat="bat"
alias help='tldr'
alias preview="fzf --preview 'bat --color \"always\" {}'"
alias speed-test="curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -"
alias yn="yarn"
alias pn="pnpm"
alias dc="docker"
alias tailscale="/Applications/Tailscale.app/Contents/MacOS/Tailscale"
alias zed="/Applications/Zed.app"
# ----------------------------------- fzf -----------------------------------
# add support for ctrl+o to open selected file in VS Code
export FZF_DEFAULT_OPTS="--bind='ctrl-o:execute(code {})+abort'"
export FZF_DEFAULT_COMMAND="rg --files"
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
# Options to fzf command
export FZF_COMPLETION_OPTS='--border --info=inline'
# Use fd (https://github.com/sharkdp/fd) instead of the default find
# command for listing path candidates.
# - The first argument to the function ($1) is the base path to start traversal
# - See the source code (completion.{bash,zsh}) for the details.
_fzf_compgen_path() {
fd --hidden --follow --exclude ".git" . "$1"
}
# Use fd to generate the list for directory completion
_fzf_compgen_dir() {
fd --type d --hidden --follow --exclude ".git" . "$1"
}
# (EXPERIMENTAL) Advanced customization of fzf options via _fzf_comprun function
# - The first argument to the function is the name of the command.
# - You should make sure to pass the rest of the arguments to fzf.
_fzf_comprun() {
local command=$1
shift
case "$command" in
cd) fzf "$@" --preview 'tree -C {} | head -200' ;;
export|unset) fzf "$@" --preview "eval 'echo \$'{}" ;;
ssh) fzf "$@" --preview 'dig {}' ;;
*) fzf "$@" ;;
esac
}
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# ----------------------------------- SSH -----------------------------------
# start up ssh-agent on login
if [ ! -S ~/.ssh/ssh_auth_sock ]; then
eval `ssh-agent`
ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock
fi
export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock
ssh-add -l > /dev/null || ssh-add
# ----------------------------------- pyenv -----------------------------------
# if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
# fi
# ----------------------------------- utility functions -----------------------------------
timezsh() {
shell=${1-$SHELL}
for i in $(seq 1 10); do /usr/bin/time $shell -i -c exit; done
}
# ----------------------------------- EXTRA -----------------------------------
# disable homebrew from updating on every run
export HOMEBREW_NO_AUTO_UPDATE=1
autoload -U bashcompinit
bashcompinit
# if command -v pyenv 1>/dev/null 2>&1; then
# eval "$(pyenv init -)"
# eval "$(pyenv virtualenv-init -)"
# fi
. $HOME/z/z.sh
eval "$(starship init zsh)"
# bun completions
[ -s "/Users/aadeshchandra/.bun/_bun" ] && source "/Users/aadeshchandra/.bun/_bun"
eval "$(atuin init zsh)"