-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzshrc
More file actions
executable file
·160 lines (122 loc) · 3.72 KB
/
zshrc
File metadata and controls
executable file
·160 lines (122 loc) · 3.72 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
# =============================================================================
# ZSHRC CONFIGURATION
# =============================================================================
# Last updated: $(date +%Y-%m-%d)
# Description: Personal zsh configuration with oh-my-zsh, starship, and customizations
# =============================================================================
# ENVIRONMENT SETUP
# =============================================================================
# Check if running in a coding agent environment
# Common indicators: specific environment variables, process names, or parent processes
is_coding_agent() {
[[ -n "$CODING_AGENT" || -n "$CURSOR_AI" || -n "$VSCODE_AI" || -n "$CODESPACE" ]]
}
if is_coding_agent; then
exit 0
fi
# Set name of the theme to load.
ZSH_THEME=""
# Language environment
LANG="en_US.UTF-8"
# Oh-my-zsh configuration
MODULES_DIR=$HOME/.dotfiles/modules
export ZSH=$MODULES_DIR/oh-my-zsh
# Oh-my-zsh settings
DISABLE_AUTO_UPDATE="true"
COMPLETION_WAITING_DOTS="true"
HIST_STAMPS="mm/dd/yyyy"
# =============================================================================
# PLUGIN CONFIGURATION
# =============================================================================
# Core plugins
plugins=(
common-aliases
extract
git
pip
pj
)
# Project Jump configuration
PROJECT_PATHS=($HOME/Developer $HOME/Git)
# Conditional plugin loading based on available commands
if (( $+commands[apt] )); then
plugins+=(ubuntu)
fi
if (( $+commands[brew] )); then
plugins+=(brew)
fi
if (( $+commands[direnv] )); then
plugins+=(direnv)
fi
if (( $+commands[gh] )); then
plugins+=(gh)
fi
if (( $+commands[fzf] )); then
plugins+=(fzf)
fi
if (( $+commands[kubectl] )); then
plugins+=(kubectl)
fi
if (( $+commands[terraform] )); then
plugins+=(terraform)
fi
if (( $+commands[yarn] )); then
plugins+=(yarn)
fi
if (( $+commands[systemd] )); then
plugins+=(systemd)
fi
# =============================================================================
# DEVELOPMENT ENVIRONMENT SETUP
# =============================================================================
# Node.js (NVM)
if [[ -d "$HOME/.nvm" ]]; then
export NVM_DIR="$HOME/.nvm"
export NODE_VERSIONS="$HOME/.nvm/versions/node/"
plugins+=(npm)
plugins+=(nvm)
zstyle ':omz:plugins:nvm' lazy yes
fi
# Ruby (rbenv)
if [[ -d "$HOME/.rbenv" ]] && command -v rbenv >/dev/null 2>&1; then
eval "$(rbenv init - zsh 2>/dev/null)"
fi
source "$MODULES_DIR/zsh-autosuggestions/zsh-autosuggestions.zsh"
source $ZSH/oh-my-zsh.sh
eval "$(starship init zsh)"
# Homebrew completion
if type brew &>/dev/null; then
FPATH=$(brew --prefix)/share/zsh/site-functions:$FPATH
autoload -Uz compinit
compinit
fi
if (( $+commands[git-town] )); then
source <(git-town completions zsh)
fi
if (( $+commands[tailscale] )); then
tailscale completion zsh > "${fpath[1]}/_tailscale"
fi
# Always load syntax highlighting last
source "$MODULES_DIR/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh"
# 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`.
# Aliases
alias ..2='cd ../../'
alias ..3='cd ../../../'
alias e="$EDITOR"
alias et='emacsclient -t'
alias ec='emacsclient -c'
alias hib='systemctl hibernate'
alias sus='systemctl suspend'
alias reb='systemctl reboot'
alias tg='topgrade'
# Functions
function reload() {
exec zsh
}
# pnpm
# tabtab source for packages
# uninstall by removing these lines
[[ -f ~/.config/tabtab/zsh/__tabtab.zsh ]] && . ~/.config/tabtab/zsh/__tabtab.zsh || true