-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzshrc
More file actions
176 lines (142 loc) · 5.35 KB
/
Copy pathzshrc
File metadata and controls
176 lines (142 loc) · 5.35 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
#!/bin/zsh
# .zshrc - Zsh file loaded on interactive shell sessions.
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
eval "$(/opt/homebrew/bin/brew shellenv)"
export PATH=$HOME/bin:/usr/local/bin:${KREW_ROOT:-$HOME/.krew}/bin:/Users/vedantrathore/Library/Python/3.13/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# set colors
export TERM="xterm-256color" # This sets up colors properly
# set shell
export SHELL=$(which zsh)
function is-macos() {
[[ $OSTYPE == darwin* ]]
}
# Initialize antidote with static caching (much faster)
source $HOME/.dotfiles/vendor/github/antidote/antidote.zsh
zsh_plugins=$HOME/.zsh_plugins.zsh
if [[ ! ${zsh_plugins} -nt ${ZDOTDIR:-$HOME}/.zsh_plugins.txt ]]; then
antidote bundle <${ZDOTDIR:-$HOME}/.zsh_plugins.txt >|${zsh_plugins}
fi
source ${zsh_plugins}
# History
HISTSIZE=5000
HISTFILE=~/.zsh_history
SAVEHIST=$HISTSIZE
HISTDUP=erase
HIST_STAMPS="dd/mm/yyyy"
setopt appendhistory
setopt share_history
setopt hist_ignore_space
setopt hist_ignore_all_dups
setopt hist_save_no_dups
setopt hist_ignore_dups
setopt hist_find_no_dups
for file in ~/.{exports,aliases,functions,p10k.zsh}; do
[ -r "$file" ] && [ -f "$file" ] && source "$file";
done;
unset file;
# Zsh options.
setopt extended_glob
# Note: compinit is handled by belak/zsh-utils completion plugin
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zstyle ':completion:*' list-colors '${(s.:.)LS_COLORS}'
zstyle ':completion:*' menu no
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'eza -1 --color=always --group-directories-first --icons $realpath'
zstyle ':fzf-tab:complete:__zxoide_z:*' fzf-preview 'eza -1 --color=always --group-directories-first --icons $realpath'
# Cache directory for shell init scripts
_zsh_cache="${XDG_CACHE_HOME:-$HOME/.cache}/zsh"
[[ -d $_zsh_cache ]] || mkdir -p $_zsh_cache
# Helper to cache eval output
_cached_eval() {
local name=$1 cmd=$2 cache_file="$_zsh_cache/$name.zsh"
if [[ ! -f $cache_file || ! -s $cache_file ]]; then
eval "$cmd" >| $cache_file
fi
source $cache_file
}
_cached_eval direnv 'direnv hook zsh'
_cached_eval zoxide 'zoxide init zsh'
_cached_eval atuin 'atuin init zsh --disable-up-arrow'
_cached_eval navi 'navi widget zsh'
eval "$(mise activate zsh)" # mise needs fresh eval for project switching
zvm_after_init_commands+=('source <(fzf --zsh)')
# Keybindings for productivity (must run after zsh-vi-mode init)
zvm_after_init_commands+=(
'bindkey "^y" autosuggest-accept' # Ctrl+y to accept autosuggestion
'bindkey "^f" tmux-sessionizer-widget' # Ctrl+f for tmux sessionizer
'bindkey -r "^P"' # Unbind Ctrl+P (let tmux handle it)
'bindkey -r "^N"' # Unbind Ctrl+N (let tmux handle it)
)
# Tmux sessionizer widget
tmux-sessionizer-widget() {
~/.local/bin/tmux-sessionizer
zle reset-prompt
}
zle -N tmux-sessionizer-widget
### MANAGED BY RANCHER DESKTOP START (DO NOT EDIT)
export PATH="/Users/vedantrathore/.rd/bin:$PATH"
### MANAGED BY RANCHER DESKTOP END (DO NOT EDIT)
# pnpm
export PNPM_HOME="/Users/vedantrathore/Library/pnpm"
case ":$PATH:" in
*":$PNPM_HOME:"*) ;;
*) export PATH="$PNPM_HOME:$PATH" ;;
esac
# pnpm end
export PATH="$PATH:/Users/vedantrathore/.local/bin"
. "$HOME/.local/bin/env"
# Added by Windsurf
export PATH="/Users/vedantrathore/.codeium/windsurf/bin:$PATH"
# Bitwarden secrets management
# Usage: Run `bw-secrets` to unlock vault and load API keys
# Set ANTHROPIC_BASE_URL in ~/.zshrc.local if needed
bw-secrets() {
# Check if bw is installed
if ! command -v bw &> /dev/null; then
echo "Bitwarden CLI not installed. Install with: brew install bitwarden-cli"
return 1
fi
# Check login status
if ! bw login --check &> /dev/null; then
echo "Not logged in. Run: bw login"
return 1
fi
# Unlock if needed
if [[ -z "$BW_SESSION" ]]; then
echo "Unlocking Bitwarden vault..."
export BW_SESSION=$(bw unlock --raw)
if [[ -z "$BW_SESSION" ]]; then
echo "Failed to unlock vault"
return 1
fi
fi
# Fetch secrets (store these in Bitwarden as Secure Notes with these names)
echo "Fetching secrets from Bitwarden..."
local perplexity_key=$(bw get password "PERPLEXITY_API_KEY" 2>/dev/null)
if [[ -n "$perplexity_key" ]]; then
export PERPLEXITY_API_KEY="$perplexity_key"
echo "✓ PERPLEXITY_API_KEY loaded"
else
echo "✗ PERPLEXITY_API_KEY not found in vault"
fi
}
# Google Cloud SDK (completions use autoload, not compinit)
[[ -f '/opt/homebrew/share/google-cloud-sdk/path.zsh.inc' ]] && source '/opt/homebrew/share/google-cloud-sdk/path.zsh.inc'
# Source local overrides (not tracked in git)
[[ -f ~/.zshrc.local ]] && source ~/.zshrc.local
# Added by LM Studio CLI (lms)
export PATH="$PATH:/Users/vedantrathore/.lmstudio/bin"
# End of LM Studio CLI section
# opencode
export PATH=/Users/vedantrathore/.opencode/bin:$PATH
# bun completions
[ -s "/Users/vedantrathore/.bun/_bun" ] && source "/Users/vedantrathore/.bun/_bun"
# bun
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"