-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzprofile.symlink
More file actions
72 lines (61 loc) · 2.85 KB
/
Copy pathzprofile.symlink
File metadata and controls
72 lines (61 loc) · 2.85 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
# because i always forget the difference between .zprofile and .zshrc...
# interactive login shells source zprofile and zshrc (in that order)
# interactive non-login shells source zshrc, but not zprofile
# when you open a new terminal tab, that's an interactive login shell. when you
# run `zsh` from that shell, that's an interactive non-login shell.
# (note that there's also zshenv and zlogin -- look em up if you care)
#
# things like prepending PATH or exporting other env vars should go in here,
# cuz those get passed down to non-login shells from the parent shell. things
# like defining functions or aliases should go in .zshrc, because those do not
# get passed down.
UNAME="$(uname)"
if [ "$UNAME" = 'Darwin' ]; then
# Mac puts a call to /usr/libexec/path_helper in /etc/zprofile. This causes
# problems when a login shell is launched from a shell where the PATH is
# already set up (e.g. in a VSCode or Cursor terminal). The behavior of
# path_helper is described in https://stackoverflow.com/a/48228223/3108885
# The problem is it "promotes" the paths it cares about to the front of the
# PATH. This seems like a bad idea in general, but one particular thing it
# breaks is mise shims -- while many shimming tools just recommend prepending
# your PATH manually, mise has you run `mise activate zsh --shims`, which
# first checks whether mise's shims are already on the PATH, and if so, it
# does nothing more. So if path_helper bumps the shims down in priority,
# `mise activate` doesn't move them back up.
#
# The solution is to just start from scratch, per:
# https://github.com/rbenv/rbenv/issues/369#issuecomment-36010083
if [ -f /etc/zprofile ]; then
PATH=""
# iTerm2 adds this utilities dir to the PATH. We don't want to lose that.
# Hopefully they don't ever rename it.
if [ -d /Applications/iTerm.app/Contents/Resources/utilities ]; then
PATH="/Applications/iTerm.app/Contents/Resources/utilities"
fi
source /etc/zprofile
fi
fi
export PATH=$HOME/scripts:$HOME/bin:$PATH
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
# shorten the delay between pressing ESC and entering normal mode. this might
# cause side-effects, but i doubt it will cause any i care about.
export KEYTIMEOUT=1
# Mac-only
if [ "$(uname)" = "Darwin" ]; then
if ! ssh-add -l &> /dev/null; then
ssh-add --apple-load-keychain
fi
fi
eval "$(/opt/homebrew/bin/brew shellenv)"
# MacPorts:
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
export MANPATH="/opt/local/share/man:$MANPATH"
# for Poetry, also claude i guess
export PATH="$HOME/.local/bin:$PATH"
# mise-en-place. --shims mode (means it modifies PATH) so it works in
# non-interactive sessions, e.g. VSCode, claude's Bash tool, etc.
# See also .zshrc for non-shim activation
eval "$(mise activate zsh --shims)"
# gimme `t`
export PATH=$HOME/.tmux/plugins/tmux-session-wizard/bin:$PATH