-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zshrc
184 lines (146 loc) · 5.18 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
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# ~/.zshrc
# ------------------------------------------------------------------------------
# Environment
# ------------------------------------------------------------------------------
# Export path to root of dotfiles repo
export DOTFILES=${DOTFILES:="$HOME/.dotfiles"}
# Locale
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
# Pyenv
export PATH="$(pyenv root)/shims:$PATH"
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
#eval "$(pyenv virtualenv-init -)"
# Extend $PATH without duplicates
_extend_path() {
[[ -d "$1" ]] || return
if ! $( echo "$PATH" | tr ":" "\n" | grep -qx "$1" ) ; then
export PATH="$1:$PATH"
fi
}
# Add custom bin to $PATH
_extend_path "$HOME/.local/bin"
_extend_path "$HOME/.cargo/bin"
_extend_path "$HOME/.config/bin"
_extend_path "$DOTFILES/bin"
_extend_path "$HOME/.npm-global/bin"
_extend_path "$HOME/.bun/bin"
_extend_path "$HOME/.config/bin:$PATH"
# Better formatting for time command
export TIMEFMT=$'\n================\nCPU\t%P\nuser\t%*U\nsystem\t%*S\ntotal\t%*E'
# ------------------------------------------------------------------------------
# Oh My Zsh
# ------------------------------------------------------------------------------
ZSH_DISABLE_COMPFIX=true
# Autoload node version when changing cwd
zstyle ':omz:plugins:nvm' autoload true
# Use passphase from macOS keychain
if [[ "$OSTYPE" == "darwin"* ]]; then
zstyle :omz:plugins:ssh-agent ssh-add-args --apple-load-keychain
fi
# ------------------------------------------------------------------------------
# Dependencies
# ------------------------------------------------------------------------------
# load zgenom
source "${HOME}/.zgenom/zgenom.zsh"
# Check for plugin and zgenom updates every 7 days
# This does not increase the startup time.
zgenom autoupdate
# if the init script doesn't exist
if ! zgenom saved; then
echo "Creating a zgenom save"
# Ohmyzsh base library
zgenom ohmyzsh
# Oh-My-Zsh plugins
zgenom ohmyzsh plugins/git
zgenom ohmyzsh plugins/history-substring-search
zgenom ohmyzsh plugins/sudo
zgenom ohmyzsh plugins/command-not-found
zgenom ohmyzsh plugins/npm
zgenom ohmyzsh plugins/yarn
zgenom ohmyzsh plugins/nvm
zgenom ohmyzsh plugins/extract
zgenom ohmyzsh plugins/ssh-agent
zgenom ohmyzsh plugins/gpg-agent
zgenom ohmyzsh plugins/macos
zgenom ohmyzsh plugins/vscode
zgenom ohmyzsh plugins/gh
zgenom ohmyzsh plugins/common-aliases
zgenom ohmyzsh plugins/docker
zgenom ohmyzsh plugins/pyenv
# zgenom ohmyzsh plugins/pipenv
zgenom ohmyzsh plugins/pip
zgenom ohmyzsh plugins/python
zgenom ohmyzsh plugins/virtualenv
# Custom plugins
zgenom load chriskempson/base16-shell
zgenom load djui/alias-tips
zgenom load agkozak/zsh-z
zgenom load hlissner/zsh-autopair
zgenom load zsh-users/zsh-syntax-highlighting
zgenom load zsh-users/zsh-autosuggestions
zgenom load MichaelAquilina/zsh-autoswitch-virtualenv
zgenom load agkozak/zsh-z
# Files
zgenom load $DOTFILES/lib
# just load the completions
zgenom ohmyzsh --completion plugins/docker-compose
# Install ohmyzsh osx plugin if on macOS
[[ "$(uname -s)" = Darwin ]] && zgenom ohmyzsh plugins/macos
# add binaries
zgenom bin tj/git-extras
# completions
zgenom load zsh-users/zsh-completions
# save all to init script
zgenom save
# Compile your zsh files
zgenom compile "$HOME/.zshrc"
fi
# ______________________________________________________________________________
# NVM
# export NVM_DIR="$HOME/.nvm"
# [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# # FZF
# [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
# Fuzzy finder bindings
if [ -f "$HOME/.fzf.zsh" ]; then
source "$HOME/.fzf.zsh"
fi
# Pipenv
eval "$(_PIPENV_COMPLETE=zsh_source pipenv)"
# homebrew
export PATH="/opt/homebrew/opt/curl/bin:$PATH"
eval "$(starship init zsh)"
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/opt/homebrew/Caskroom/miniconda/base/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/opt/homebrew/Caskroom/miniconda/base/etc/profile.d/conda.sh" ]; then
. "/opt/homebrew/Caskroom/miniconda/base/etc/profile.d/conda.sh"
else
export PATH="/opt/homebrew/Caskroom/miniconda/base/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
export PATH="~/.config/bin:$PATH"
# Source local configuration
if [[ -f "$HOME/.zshlocal" ]]; then
source "$HOME/.zshlocal"
fi
[[ "$TERM_PROGRAM" == "CodeEditApp_Terminal" ]] && . "/Applications/CodeEdit.app/Contents/Resources/codeedit_shell_integration.zsh"
# # Fig post block. Keep at the bottom of this file.
# [[ -f "$HOME/.fig/shell/zshrc.post.zsh" ]] && builtin source "$HOME/.fig/shell/zshrc.post.zsh"
eval "$(atuin init zsh)"
# . "$HOME/.cargo/env"
#
# append completions to fpath
fpath=(${ASDF_DIR}/completions $fpath)
# initialise completions with ZSH's compinit
autoload -Uz compinit && compinit