-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshrc##os.Darwin
129 lines (104 loc) · 3.21 KB
/
.zshrc##os.Darwin
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
# manually set language environment
export LANG=en_US.UTF-8
# create variable for JetBrains Toolbox scripts path
if [ -d "${HOME}/Library/Application Support/JetBrains/Toolbox" ]; then
JETBRAINS_TOOLBOX_PATH="${PATH}:${HOME}/Library/Application Support/JetBrains/Toolbox/scripts"
else
JETBRAINS_TOOLBOX_PATH=""
fi
# define custom location for configuration files
export XDG_CONFIG_HOME="$HOME/.config"
# define preferred editor
if command -v nvim &>/dev/null; then
export EDITOR='nvim'
else
export EDITOR='vim'
fi
# pyenv is installed with homebrew, so homebrew must be setup first
if [ -f /opt/homebrew/bin/brew ]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
# append bin directories with executables to path.
export PATH="${HOME}/go/bin:${HOME}/.local/bin:${HOME}/bin:/usr/local/bin:${JETBRAINS_TOOLBOX_PATH}:${PATH}"
# setup pyenv
# this happens after configuring PATH, so utilities from pyenv environments are used before
# global utilities (and pipx utilities)
eval "$(pyenv init --path)"
# define custom path for starship configuration
export STARSHIP_CONFIG="${HOME}/.config/starship/starship.toml"
# path to oh-my-zsh installation.
export ZSH="${HOME}/.oh-my-zsh"
# disable theme because prompt is managed by starship
# shellcheck disable=SC2034
ZSH_THEME=""
# define custom folder (default is `$ZSH/custom`)
ZSH_CUSTOM="$HOME/.oh-my-zsh-custom"
# source secrets
# shellcheck source=/dev/null
[ -f ~/.secrets.sh ] && . ~/.secrets.sh
# source work helpers
# shellcheck source=/dev/null
[ -f ~/.work.zsh ] && . ~/.work.zsh
# Specify oh-my-zsh plugins
# shellcheck disable=SC2034
plugins=(
# order matters!
aws
git
cp
history
docker
nvm
npm
colorize
colored-man-pages
copypath
web-search
jump
pyenv
gh
zsh-autosuggestions
zsh-syntax-highlighting
vi-mode
fzf
pip
zoxide
starship
)
# Define directories for "function search path", which contain files
# that can be marked to be loaded automatically when the function they
# contain is needed for the first time.
# See https://unix.stackexchange.com/a/33898/521611 for more info on $fpath
fpath_dirs=(
"${ZSH_CUSTOM}/plugins/zsh-completions/src"
"${ZSH_CUSTOM}/completions"
)
# conditionally add brew
if command -v brew &>/dev/null; then
fpath_dirs+=("$(brew --prefix)/share/zsh/site-functions")
fi
# append to fpath
fpath=("${fpath_dirs[@]}" "${fpath[@]}")
# install oh-my-zsh
# this will call `compinit` to initialize the zsh completion system
# shellcheck source=/dev/null
source "${ZSH}/oh-my-zsh.sh"
# https://superuser.com/a/1447349
unset LESS
# load bash completion compatibility layer
autoload -U bashcompinit
bashcompinit
# configure auto completion for pipx
eval "$(register-python-argcomplete pipx)"
# configure auto completion for pipenv
eval "$(_PIPENV_COMPLETE=zsh_source pipenv)"
# setup direnv
eval "$(direnv hook zsh)"
# prevent virtualenv from changing the prompt
# starship will display the virtualenv name
export VIRTUAL_ENV_DISABLE_PROMPT=1
# alias for other nvim distributions
alias nvim-lazy="NVIM_APPNAME=lazyvim nvim"
alias nvim-kickstart="NVIM_APPNAME=kickstart nvim"
alias nvim-chad="NVIM_APPNAME=nvchad nvim"
alias nvim-lunar="${HOME}/.local/bin/lvim"