-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzshrc
60 lines (44 loc) · 1.24 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
# shellcheck shell=bash
fpath+=("${HOME}/.zfunctions")
fpath=("${LOCAL_DIR}/lib/python3.11/site-packages/argcomplete/bash_completion.d" "${fpath[@]}")
autoload -U promptinit
promptinit
# zstyle ':prompt:purus:prompt:success' color green
prompt purus
autoload -U +X compinit
compinit
autoload -U +X bashcompinit
bashcompinit
autoload -U add-zsh-hook
export MANPAGER='nvim +Man!'
eval "$(register-python-argcomplete pipx)"
load-nvmrc() {
local nvmrc_path
nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "${nvmrc_path}" ]; then
local nvmrc_node_version
nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
if [ "${nvmrc_node_version}" = "N/A" ]; then
nvm install
elif [ "${nvmrc_node_version}" != "$(nvm version)" ]; then
nvm use
fi
elif [ -n "$(PWD=${OLDPWD} nvm_find_nvmrc)" ] && [ "$(nvm version)" != "$(nvm version default)" ]; then
echo "Reverting to nvm default version"
nvm use default
fi
}
add-zsh-hook chpwd load-nvmrc
load-nvmrc
for file in ~/.bash/*.sh; do
# shellcheck disable=SC1090
source "${file}"
done
unset file
# The Zsh options for reference:
# https://zsh.sourceforge.io/Doc/Release/Options.html
for file in ~/.zsh/*.zsh; do
# shellcheck disable=SC1090
source "${file}"
done
unset file