-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathzshrc
More file actions
184 lines (147 loc) · 6.03 KB
/
zshrc
File metadata and controls
184 lines (147 loc) · 6.03 KB
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
### q slow debugging ###
# date
# echo "STARTING: amazon q pre block loading from .zshrc"
# # set zsh to echo verbose
# set -x
# ###
# only run if LOADING_Q is true
if [[ "$LOADING_Q" == "true" ]]; then
# Kiro CLI post block. Keep at the bottom of this file.
# This is in an if statement because Amazon Q / Kiro CLI is _really_ poorly written and slows down your terminal
# See https://github.com/aws/amazon-q-developer-cli/discussions/202
[[ -f "${HOME}/Library/Application Support/kiro-cli/shell/zshrc.pre.zsh" ]] && builtin source "${HOME}/Library/Application Support/kiro-cli/shell/zshrc.pre.zsh"
fi
# ### q slow debugging ###
# date
# # unset zsh to echo verbose
# set +x
# echo "DONE: amazon q pre block loaded from .zshrc"
###
## AMAZON Q MAKES EVERYTHING SLOWWWWWW
# shellcheck disable=SC2148 disable=SC1090 shell=bash
# ~/.zshrc
# set +x
# only run set +m if we're interactive
if [[ $- == *i* ]]; then
set +m # Make jobs quiet by default
fi
# There is an alias to jump to the directory with the various
# included zsh configs, simply type `zshconfig` at the prompt.
####### PROFILING #######
# Uncomment below to enable debug timing
# zmodload zsh/zprof
# Remember to uncomment zprof at the end of the file!
#### END PROFILING ######
bg_silent() {
# background a task quietly and disown
{ "$@" 2>&3 & } 3>&2 2>/dev/null
disown &>/dev/null
}
## Source all configs
if [[ -d $HOME/Library/Mobile\ Documents/com\~apple\~CloudDocs/Dropbox\ Import/dotfiles/shell_config ]]; then
for file in "$HOME"/Library/Mobile\ Documents/com\~apple\~CloudDocs/Dropbox\ Import/dotfiles/shell_config/*.rc; do
source "$file"
done
fi
## Add ssh keys to agent if not already added
# ssh-add-keys # TODO: disabled 2025-03-16 to see if it helps performance, reenable if ssh stops working
### Below are items added by installer scripts (usually homebrew) ####
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
source /opt/homebrew/Cellar/fzf/*/shell/key-bindings.zsh
# Enable direnv - https://direnv.net
# eval "$(direnv hook zsh)"
zstyle ':completion:*' menu select
fpath+=~/.zfunc
# only run set -m if we're interactive
if [[ $- == *i* ]]; then
set -m # reenable job output
fi
# >>> mamba initialize >>>
# !! Contents within this block are managed by 'mamba init' !!
# export MAMBA_EXE='/opt/homebrew/opt/micromamba/bin/micromamba';
# export MAMBA_ROOT_PREFIX='/Users/samm/micromamba';
# __mamba_setup="$("$MAMBA_EXE" shell hook --shell zsh --root-prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)"
# if [ $? -eq 0 ]; then
# eval "$__mamba_setup"
# else
# alias micromamba="$MAMBA_EXE" # Fallback on help from mamba activate
# fi
# unset __mamba_setup
# # <<< mamba initialize <<<
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
# __conda_setup="$('/opt/homebrew/Caskroom/mambaforge/base/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
# if [ $? -eq 0 ]; then
# eval "$__conda_setup"
# else
# if [ -f "/opt/homebrew/Caskroom/mambaforge/base/etc/profile.d/conda.sh" ]; then
# . "/opt/homebrew/Caskroom/mambaforge/base/etc/profile.d/conda.sh"
# else
# export PATH="/opt/homebrew/Caskroom/mambaforge/base/bin:$PATH"
# fi
# fi
# unset __conda_setup
# if [ -f "/opt/homebrew/Caskroom/mambaforge/base/etc/profile.d/mamba.sh" ]; then
# . "/opt/homebrew/Caskroom/mambaforge/base/etc/profile.d/mamba.sh"
# fi
# <<< conda initialize <<<
# Load custom aliases
export PATH="$PATH:/Users/samm/Fltr"
# tabtab source for electron-forge package
# uninstall by removing these lines or running `tabtab uninstall electron-forge`
# [[ -f /Users/samm/.npm/_npx/6913fdfd1ea7a741/node_modules/tabtab/.completions/electron-forge.zsh ]] && . /Users/samm/.npm/_npx/6913fdfd1ea7a741/node_modules/tabtab/.completions/electron-forge.zsh
# Added by LM Studio CLI tool (lms)
export PATH="$PATH:/Users/samm/.cache/lm-studio/bin"
if [ -f "/Users/samm/.config/fabric/fabric-bootstrap.inc" ] && if_not_in_vscode; then . "/Users/samm/.config/fabric/fabric-bootstrap.inc"; fi
fpath+=~/.zfunc
export PATH="/opt/homebrew/opt/tcl-tk@8/bin:$PATH"
# # The next line updates PATH for the Google Cloud SDK.
# if [ -f '/Users/samm/Downloads/google-cloud-sdk/path.zsh.inc' ] && if_not_in_vscode; then . '/Users/samm/Downloads/google-cloud-sdk/path.zsh.inc'; fi
# The next line enables shell command completion for gcloud.
# if [ -f '/Users/samm/Downloads/google-cloud-sdk/completion.zsh.inc' ] && if_not_in_vscode; then . '/Users/samm/Downloads/google-cloud-sdk/completion.zsh.inc'; fi
# ####### PROFILING #######
# # Uncomment below to enable debug timing
# zprof
# #### END PROFILING ######
# echo ".zshrc loaded now"
# >>> CLOI_HISTORY_SETTINGS >>>
setopt INC_APPEND_HISTORY
setopt SHARE_HISTORY
# <<< CLOI_HISTORY_SETTINGS <<<
export PATH="$HOME/.local/bin:$PATH"
# [[ "$TERM_PROGRAM" == "kiro" ]] && . "$(kiro --locate-shell-integration-path zsh)"
# Added by Antigravity
# export PATH="/Users/samm/.antigravity/antigravity/bin:$PATH"
### zoxide ###
if [ -z "$RUNNING_IN_VSCODE" ]; then
eval "$(zoxide init zsh)"
# Override z to support z - (go to previous directory)
typeset -g _ZOXIDE_OLDPWD="$PWD"
typeset -g _ZOXIDE_CURPWD="$PWD"
_track_directory() {
_ZOXIDE_OLDPWD="$_ZOXIDE_CURPWD"
_ZOXIDE_CURPWD="$PWD"
}
autoload -Uz add-zsh-hook
add-zsh-hook chpwd _track_directory
z() {
if [[ "$1" == "-" ]]; then
if [[ -n "$_ZOXIDE_OLDPWD" && -d "$_ZOXIDE_OLDPWD" ]]; then
__zoxide_z "$_ZOXIDE_OLDPWD"
else
echo "z: no previous directory" >&2
return 1
fi
else
__zoxide_z "$@"
fi
}
fi
### zoxide ###
# # Amazon Q post block. Keep at the bottom of this file.
if [[ "$LOADING_Q" == "true" ]]; then
# Amazon Q post block. Keep at the bottom of this file.
# This is in an if statement because Amazon Q / Kiro CLI is _really_ poorly written and slows down your terminal
# See https://github.com/aws/amazon-q-developer-cli/discussions/202
[[ -f "${HOME}/Library/Application Support/kiro-cli/shell/zshrc.post.zsh" ]] && builtin source "${HOME}/Library/Application Support/kiro-cli/shell/zshrc.post.zsh"
fi