-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.exports
More file actions
76 lines (69 loc) · 2.25 KB
/
Copy path.exports
File metadata and controls
76 lines (69 loc) · 2.25 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
#!/usr/bin/env zsh
# constants
export ARCH=$(uname -m)
export PAGER=/usr/bin/less
export CLICOLOR=1
export HOST_UID=$(id -u)
export USERNAME=$(whoami)
# real name lookup differs per platform
# resolved here (not in the .exports.$os sibling) because the derived
# NAME_ARRAY / FIRST_NAME / LAST_NAME logic below is shared and the sibling
# is sourced after this file
case $DOTFILES_OS in
darwin) export NAME=$(dscl . -read "/Users/$USERNAME" RealName | sed -n 's/^ //g;2p') ;;
linux) export NAME=$(getent passwd "$USERNAME" | cut -d: -f5 | cut -d, -f1) ;;
esac
# ${=NAME} forces word splitting; zsh does not split unquoted params by default
export NAME_ARRAY=(${=NAME})
export NAME_ARRAY_LENGTH=${#NAME_ARRAY[@]}
export FIRST_NAME="Jedi"
export LAST_NAME="Master"
# zsh arrays are 1-indexed
[[ $NAME_ARRAY_LENGTH -eq 2 ]] &&
export FIRST_NAME=${NAME_ARRAY[1]} &&
export LAST_NAME=${NAME_ARRAY[2]}
# cross-platform homebrew settings
export HOMEBREW_FORCE_BREWED_CURL=1
export HOMEBREW_NO_ANALYTICS=1
export HOMEBREW_NO_AUTO_UPDATE=1
export NVM_AUTOLOAD=1
export BUN_INSTALL=$HOME/.bun
export GOPATH=$HOME/go
export GOBIN=$GOPATH/bin
export CARGO_HOME=$HOME/.cargo
export RUSTUP_HOME=$HOME/.rustup
export PYENV_ROOT=$HOME/.pyenv
export GLAB_SEND_TELEMETRY=false
export GPG_TTY=$(tty)
export RBENV_HOME=$HOME/.rbenv
export K9S_CONFIG_DIR=$HOME/.config/k9s
# editor drives the config-editing aliases in the shared .aliases; set here
# (exports is sourced before aliases) so the aliases can expand it
case $DOTFILES_OS in
darwin) export EDITOR=nvim ;;
*) export EDITOR=vim ;;
esac
# paths
# an array literal reads top-to-bottom (first entry = highest priority).
# os-specific entries (e.g. homebrew) are prepended by the .exports.$os sibling.
typeset -U path PATH
path=(
$HOME/.local/bin
$BUN_INSTALL/bin
$CARGO_HOME/bin
$GOBIN
$PYENV_ROOT/bin
$PYENV_ROOT/shims
$RBENV_HOME/bin
$HOME/.composer/vendor/bin
$HOME/.docker/bin
$HOME/.jenv/bin
$HOME/flutter/bin
${KREW_ROOT:-$HOME/.krew}/bin
$path
)
# the active ruby version's bin, only if rbenv has a version pinned
[[ -r $RBENV_HOME/version ]] &&
path=($RBENV_HOME/versions/$(cat $RBENV_HOME/version)/bin $path)
# keep only directories that exist
path=($^path(N-/))