forked from romkatv/dotfiles-public
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.zshenv
37 lines (32 loc) · 1.22 KB
/
.zshenv
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
if [ -n "${ZSH_VERSION-}" ]; then
: ${ZDOTDIR:=~}
setopt no_global_rcs
[[ ! -e ~/.zshenv-private ]] || source ~/.zshenv-private
if [[ -o no_interactive && -z "${Z4H_BOOTSTRAPPING-}" ]]; then
return
fi
setopt no_rcs
unset Z4H_BOOTSTRAPPING
[[ -n "${Z4H_SSH-}" ]] || HISTFILE="$ZDOTDIR/.zsh_history.${(%):-%m}"
fi
Z4H_URL="https://raw.githubusercontent.com/romkatv/zsh4humans/v5"
: "${Z4H:=${XDG_CACHE_HOME:-$HOME/.cache}/zsh4humans/v5}"
[ -d ~/zsh4humans/main ] && Z4H_BOOTSTRAP_COMMAND='ln -s ~/zsh4humans/main "$Z4H_PACKAGE_DIR"'
umask o-w
if [ ! -e "$Z4H"/z4h.zsh ]; then
mkdir -p -- "$Z4H" || return
>&2 printf '\033[33mz4h\033[0m: fetching \033[4mz4h.zsh\033[0m\n'
if [ -e ~/zsh4humans/main/z4h.zsh ]; then
ln -s -- ~/zsh4humans/main/z4h.zsh "$Z4H"/z4h.zsh.$$ || return
elif command -v curl >/dev/null 2>&1; then
curl -fsSL -- "$Z4H_URL"/z4h.zsh >"$Z4H"/z4h.zsh.$$ || return
elif command -v wget >/dev/null 2>&1; then
wget -O- -- "$Z4H_URL"/z4h.zsh >"$Z4H"/z4h.zsh.$$ || return
else
>&2 printf '\033[33mz4h\033[0m: please install \033[32mcurl\033[0m or \033[32mwget\033[0m\n'
return 1
fi
mv -- "$Z4H"/z4h.zsh.$$ "$Z4H"/z4h.zsh || return
fi
. "$Z4H"/z4h.zsh || return
setopt rcs