-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathzshrc
134 lines (105 loc) · 3.97 KB
/
zshrc
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
# ▄███████▄ ▄████████ ▄█ █▄
# ██▀ ▄██ ███ ███ ███ ███
# ▄███▀ ███ █▀ ███ ███
# ▀█▀▄███▀▄▄ ███ ▄███▄▄▄▄███▄▄
# ▄███▀ ▀ ▀███████████ ▀▀███▀▀▀▀███▀
# ▄███▀ ███ ███ ███
# ███▄ ▄█ ▄█ ███ ███ ███
# ▀████████▀ ▄████████▀ ███ █▀
#
export LANG="en_US.UTF-8"
# set XDG paths
export XDG_CACHE_HOME="${HOME}/.cache"
export XDG_DATA_HOME="${HOME}/.local/share"
export XDG_CONFIG_HOME="${HOME}/.config"
# load zinit
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git"
source "${ZINIT_HOME}/zinit.zsh"
# these must be here because otherwise mise packages will get pushed after brew (files
# are loaded in alphabetical order) - this is not ideal, but it's the best
# solution for now
# ===================================
# set homebrew on path (Intel)
export PATH="/usr/local/bin:$PATH"
# set homebrew on path (Apple Silicon) - should be first to override system bins
# (e.g. for updating zsh or bash)
export PATH="/opt/homebrew/bin:$PATH"
# ===================================
# load all config files
for f in ${XDG_CONFIG_HOME}/zsh/*; do
source $f
done
ITERM2_INTEGRATION_SCRIPT="${HOME}/.iterm2_shell_integration.zsh"
test -e "$ITERM2_INTEGRATION_SCRIPT" && source "$ITERM2_INTEGRATION_SCRIPT"
# Preferred editor for local and remote sessions
if [ -z ${EDITOR+x} ]; then
export EDITOR='nvim'
fi
# Editor for git commits, rebases etc (don't set it if it was set already...
# i.e. by NeoVim)
if [ -z ${GIT_EDITOR+x} ]; then
export GIT_EDITOR='nvim'
fi
# ssh
export SSH_KEY_PATH="$HOME/.ssh/id_rsa"
# set cabal and haskell binaries on path
export PATH="$HOME/.cabal/bin:$HOME/.local/bin:$PATH"
# Golang
export PATH="/usr/local/go/bin:$PATH"
# dotfiles scripts
export PATH="$HOME/dotfiles/bin:$PATH"
# for android sdk (installed via homebrew)
export ANDROID_HOME=/usr/local/opt/android-sdk
if [[ -f ~/.ssh/id_rsa.pub ]]; then
export SSH_FINGERPRINT=$(ssh-keygen -lf ~/.ssh/id_rsa.pub | awk '{print $2}')
fi
case "$(uname -s)" in
Darwin*)
# ruby-build -> configure readline path from homebrew
export RUBY_CONFIGURE_OPTS=--with-readline-dir="$BREW_PREFIX/opt/readline"
;;
Linux*)
# ruby-build -> configure readline path
export RUBY_CONFIGURE_OPTS=--with-readline-dir="/usr/include/readline"
;;
esac
# tell RipGrep where to look for it's config file
export RIPGREP_CONFIG_PATH="$HOME/.config/ripgrep/config"
[[ -f ~/.zinitrc ]] && source ~/.zinitrc
# load aliases
[[ -f ~/.aliases ]] && source ~/.aliases
# Local config
[[ -f ~/.zshrc.local ]] && source ~/.zshrc.local
# add go path bin to path
export PATH=$PATH:$GOPATH/bin
# qt
case "$(uname -s)" in
Darwin*)
# don't mess with this.. or erlang will stop compiling.
;;
Linux*)
export PATH="/usr/local/opt/libpq/bin:$PATH"
export PATH="/usr/local/opt/qt/bin:$PATH"
export LDFLAGS="$LDFLAGS -L/usr/local/opt/qt/lib"
export CPPFLAGS="-I/usr/local/opt/qt/include"
;;
esac
# OPEN SSL
# =====================================================
case "$(uname -s)" in
Darwin*)
# don't mess with this.. or erlang will stop compiling.
;;
Linux*)
export PATH="/usr/local/opt/[email protected]/bin:$PATH"
# For compilers to find [email protected] you may need to set:
export LDFLAGS="$LDFLAGS -L/usr/local/opt/[email protected]/lib"
export CPPFLAGS="$CPPFLAGS -I/usr/local/opt/[email protected]/include"
# For pkg-config to find [email protected] you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig"
;;
esac
export PATH="$HOME/.cargo/bin:$PATH"
# set up starship prompt
export STARSHIP_CONFIG="$HOME/.config/starship/config.toml"
eval "$(starship init zsh)"