-
Notifications
You must be signed in to change notification settings - Fork 31
/
.zshenv
32 lines (27 loc) · 1009 Bytes
/
.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
#!/bin/zsh
#
# .zshenv: Zsh environment file, loaded always.
#
export ZDOTDIR=${ZDOTDIR:-$HOME/.config/zsh}
# XDG
export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config}
export XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache}
export XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
export XDG_STATE_HOME=${XDG_STATE_HOME:-$HOME/.local/state}
export XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-$HOME/.xdg}
export XDG_PROJECTS_DIR=${XDG_PROJECTS_DIR:-$HOME/Projects}
# Fish-like dirs
: ${__zsh_config_dir:=${ZDOTDIR:-${XDG_CONFIG_HOME:-$HOME/.config}/zsh}}
: ${__zsh_user_data_dir:=${XDG_DATA_HOME:-$HOME/.local/share}/zsh}
: ${__zsh_cache_dir:=${XDG_CACHE_HOME:-$HOME/.cache}/zsh}
# Ensure Zsh directories exist.
() {
local zdir
for zdir in $@; do
[[ -d "${(P)zdir}" ]] || mkdir -p -- "${(P)zdir}"
done
} __zsh_{config,user_data,cache}_dir XDG_{CONFIG,CACHE,DATA,STATE}_HOME XDG_{RUNTIME,PROJECTS}_DIR
# Make Terminal.app behave.
if [[ "$OSTYPE" == darwin* ]]; then
export SHELL_SESSIONS_DISABLE=1
fi