-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.zshrc
More file actions
233 lines (194 loc) · 8.64 KB
/
Copy path.zshrc
File metadata and controls
233 lines (194 loc) · 8.64 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
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
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH
# Path to your Oh My Zsh installation.
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="" # was "spaceship" (slow); using starship instead (init at bottom of file)
# Spaceship theme configuration
SPACESHIP_PROMPT_ORDER=(
user # Username section
dir # Current directory section
host # Hostname section
git # Git section (git_branch + git_status)
exec_time # Execution time
line_sep # Line break
jobs # Background jobs indicator
exit_code # Exit code section
char # Prompt character
)
SPACESHIP_PROMPT_ADD_NEWLINE=true
SPACESHIP_PROMPT_SEPARATE_LINE=true
SPACESHIP_CHAR_SYMBOL="→ "
SPACESHIP_CHAR_SUFFIX=" "
SPACESHIP_USER_SHOW=needed
SPACESHIP_HOST_SHOW=false
SPACESHIP_DIR_TRUNC=0
SPACESHIP_GIT_SYMBOL=" "
SPACESHIP_GIT_PREFIX=""
SPACESHIP_GIT_SUFFIX=" "
SPACESHIP_GIT_BRANCH_COLOR="cyan"
SPACESHIP_GIT_STATUS_PREFIX=" ["
SPACESHIP_GIT_STATUS_SUFFIX="]"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment one of the following lines to change the auto-update behavior
zstyle ':omz:update' mode reminder # just remind me to update when it's time
# Uncomment the following line to change how often to auto-update (in days).
# zstyle ':omz:update' frequency 13
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS="true"
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# 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"
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
git
fzf-tab
zsh-autosuggestions
zsh-syntax-highlighting
history
dirhistory
macos
)
source $ZSH/oh-my-zsh.sh
# fzf-tab: fuzzy completion menu with previews (loaded via omz plugin above)
zstyle ':completion:*' menu no # let fzf-tab take over
zstyle ':fzf-tab:*' fzf-flags --height=60% --border
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'eza -1 --color=always --icons "$realpath"'
zstyle ':fzf-tab:complete:*:*' fzf-preview \
'bat --color=always --line-range :80 "$realpath" 2>/dev/null || eza -1 --color=always --icons "$realpath" 2>/dev/null'
# History
HISTSIZE=50000
SAVEHIST=50000
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_SAVE_NO_DUPS
setopt SHARE_HISTORY
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
export EDITOR='nvim'
# Compilation flags
# export ARCHFLAGS="-arch $(uname -m)"
# Set personal aliases, overriding those provided by Oh My Zsh libs,
# plugins, and themes. Aliases can be placed here, though Oh My Zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
alias twork="$HOME/Dev/dotfiles/tmux-work-setup.sh"
alias tsave="$HOME/Dev/dotfiles/tmux-save.sh"
alias cat='bat --paging=never'
# OpenClaw
alias oc-start="cd ~/openclaw-sandbox && docker compose up -d openclaw-gateway"
alias oc-stop="cd ~/openclaw-sandbox && docker compose down"
alias oc-restart="cd ~/openclaw-sandbox && docker compose restart openclaw-gateway"
alias oc-status="cd ~/openclaw-sandbox && docker compose ps"
alias oc-logs="docker logs -f openclaw-sandbox-openclaw-gateway-1"
# Colors for syntax highlighting (must be set after zsh-syntax-highlighting is loaded)
# Catppuccin Mocha syntax highlighting colors
if [ -d "$ZSH_CUSTOM/plugins/zsh-syntax-highlighting" ]; then
ZSH_HIGHLIGHT_STYLES[default]=none
ZSH_HIGHLIGHT_STYLES[unknown-token]=fg=#f38ba8
ZSH_HIGHLIGHT_STYLES[reserved-word]=fg=#cba6f7
ZSH_HIGHLIGHT_STYLES[alias]=fg=#89b4fa
ZSH_HIGHLIGHT_STYLES[builtin]=fg=#89b4fa
ZSH_HIGHLIGHT_STYLES[function]=fg=#89b4fa
ZSH_HIGHLIGHT_STYLES[command]=fg=#89b4fa
ZSH_HIGHLIGHT_STYLES[precommand]=fg=#a6e3a1,underline
ZSH_HIGHLIGHT_STYLES[commandseparator]=fg=#f5c2e7
ZSH_HIGHLIGHT_STYLES[hashed-command]=fg=#89b4fa
ZSH_HIGHLIGHT_STYLES[path]=fg=#94e2d5,underline
ZSH_HIGHLIGHT_STYLES[path_prefix]=fg=#94e2d5
ZSH_HIGHLIGHT_STYLES[globbing]=fg=#f5c2e7
ZSH_HIGHLIGHT_STYLES[history-expansion]=fg=#cba6f7
ZSH_HIGHLIGHT_STYLES[single-quoted-argument]=fg=#a6e3a1
ZSH_HIGHLIGHT_STYLES[double-quoted-argument]=fg=#a6e3a1
ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]=fg=#f5e0dc
ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]=fg=#f5e0dc
ZSH_HIGHLIGHT_STYLES[assign]=fg=#f9e2af
fi
# Show hidden files in auto-complete
setopt globdots
# NOTE: previously a zshexit() hook saved tmux sessions on *every* shell exit,
# which fired constantly (once per command/pane close) and was slow. Removed —
# tmux-continuum's timer + the client-detached hook handle persistence now.
# Use `tsave` to save manually anytime.
eval "$(zoxide init --cmd cd zsh)"
# yazi: `y` opens the file manager and cd's to wherever you quit
function y() {
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd
yazi "$@" --cwd-file="$tmp"
IFS= read -r -d '' cwd < "$tmp"
[ -n "$cwd" ] && [ "$cwd" != "$PWD" ] && builtin cd -- "$cwd"
rm -f -- "$tmp"
}
# unified theme switcher — active flavor's env (BAT_THEME etc.)
[ -f ~/.config/active-theme.sh ] && source ~/.config/active-theme.sh
# fzf
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
export FZF_TMUX=1
export FZF_TMUX_OPTS="-p 80%,60%"
# theme-agnostic: fzf follows the terminal's ANSI palette (set by the Ghostty theme)
export FZF_DEFAULT_OPTS="
--color=16,fg:-1,bg:-1,fg+:-1,bg+:8,hl:5,hl+:5,info:4,prompt:5,pointer:5,marker:2,spinner:6,header:1,border:8
--border --height 60%"
export FZF_CTRL_T_OPTS="--preview 'bat --color=always --line-range :80 {}' --preview-window=right:50%"
export FZF_ALT_C_OPTS="--preview 'eza --tree --color=always {} | head -40'"
# nvm
export NVM_DIR="$HOME/.nvm"
# Lazy-load nvm itself only in interactive shells (avoids breaking scripts/CI)
if [[ $- == *i* ]]; then
_load_nvm() {
unset -f nvm node npm npx yarn _load_nvm
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh"
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm"
}
nvm() { _load_nvm; nvm "$@"; }
node() { _load_nvm; node "$@"; }
npm() { _load_nvm; npm "$@"; }
npx() { _load_nvm; npx "$@"; }
yarn() { _load_nvm; yarn "$@"; }
fi
# Digital Billing Service Environment Variables
export GOPRIVATE="github.com/razorpay/*"
export GOPATH=$HOME/go
export GOOSE_MIGRATION_DIR=internal/database/migrations
# PATH
export PATH="$NVM_DIR/versions/node/v22.22.0/bin:$HOME/Dev/dotfiles/bin:/usr/local/bin:$GOPATH/bin:$HOME/.antigravity/antigravity/bin:$PATH"
# Google Cloud SDK completion
[ -f /opt/homebrew/share/google-cloud-sdk/completion.zsh.inc ] && source /opt/homebrew/share/google-cloud-sdk/completion.zsh.inc
[ -f /opt/homebrew/share/google-cloud-sdk/path.zsh.inc ] && source /opt/homebrew/share/google-cloud-sdk/path.zsh.inc
# Fix brew completion issues
# Remove broken symlinks before compinit runs
_brew_svc="/opt/homebrew/share/zsh/site-functions/_brew_services"
if [ -L "$_brew_svc" ] && [ ! -f "$_brew_svc" ]; then
rm -f "$_brew_svc" 2>/dev/null || true
fi
unset _brew_svc
export PATH="$HOME/.local/bin:$PATH"
# starship prompt (replaces spaceship) — must be last so it wins the prompt.
# Full path to the brew build (1.26+, supports palettes); a root-owned 1.10.3
# lingers in /usr/local/bin and would otherwise shadow it.
eval "$(/opt/homebrew/bin/starship init zsh)"