-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.zshenv
More file actions
79 lines (72 loc) · 2.13 KB
/
.zshenv
File metadata and controls
79 lines (72 loc) · 2.13 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
#!/usr/bin/env zsh
# Deduplicate PATH entries
typeset -U path
# Platform detection
case "$(uname -s)" in
Darwin)
export IS_MACOS=1
# Detect Homebrew location (Apple Silicon vs Intel)
if [ -d "/opt/homebrew" ]; then
export HOMEBREW_PREFIX="/opt/homebrew"
elif [ -d "/usr/local/Homebrew" ]; then
export HOMEBREW_PREFIX="/usr/local"
fi
;;
Linux)
export IS_LINUX=1
# Check for Homebrew on Linux
if [ -d "/home/linuxbrew/.linuxbrew" ]; then
export HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew"
elif [ -d "$HOME/.linuxbrew" ]; then
export HOMEBREW_PREFIX="$HOME/.linuxbrew"
fi
;;
esac
path=(
$HOME/.local/bin
$HOME/.cargo/bin
$HOME/.opencode/bin
$path
)
# Dynamically detect dotfiles directory from this file's location
# This works both locally and in CI where the repo path may differ
if [ -L "${(%):-%x}" ]; then
# If .zshenv is a symlink (stow), resolve to find dotfiles root
# readlink gives us the target: dotfiles/.zshenv
# We need to get the directory containing that file
local real_path
real_path="$(readlink "${(%):-%x}" 2>/dev/null)"
if [ -n "$real_path" ]; then
# Handle both absolute and relative symlinks
if [[ "$real_path" = /* ]]; then
# Absolute path: /full/path/to/dotfiles/.zshenv -> /full/path/to/dotfiles
DOTFILES="${real_path:h}"
else
# Relative path: dotfiles/.zshenv -> resolve from $HOME
DOTFILES="$HOME/${real_path:h}"
fi
else
DOTFILES="$HOME/dotfiles"
fi
else
# Fallback to default location
DOTFILES="$HOME/dotfiles"
fi
# Path to your oh-my-zsh installation.
ZSH="$HOME/.oh-my-zsh"
TIMING=0
EDITOR="nvim"
VISUAL="nvim"
NVM_DIR="$HOME/.nvm"
DOTFILES_ZSH="$DOTFILES/.config/zsh"
STARSHIP_CONFIG="$DOTFILES/.config/starship.toml"
export TASKRC="$DOTFILES/.config/task/taskrc"
export TASKDATA="$HOME/.local/share/task"
SNACKS_GHOSTTY=true
# DISABLE_AUTO_UPDATE="true"
DISABLE_MAGIC_FUNCTIONS="true"
DISABLE_COMPFIX="true"
ZSH_DISABLE_COMPFIX=true
GIT_AUTO_FETCH_INTERVAL=4140
GIT_PROMPT_EXECUTABLE="haskell"
POWERLEVEL9K_INSTANT_PROMPT=quiet