forked from dotphiles/dotzsh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.zsh
47 lines (39 loc) · 1.15 KB
/
init.zsh
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
#
# dotzsh : https://github.com/dotphiles/dotzsh
#
# Initializes dotzsh.
#
# Authors:
# Robby Russell <[email protected]>
# Sorin Ionescu <[email protected]>
# Ben O'Hara <[email protected]>
#
if [ -z "${DOTZSHLOCAL}" ]; then
export DOTZSHLOCAL="$DOTZSH.local"
fi
# Check for the minimum supported version.
min_zsh_version='4.2.6'
if ! autoload -Uz is-at-least || ! is-at-least "$min_zsh_version"; then
print "dotzsh: old shell detected, minimum required: $min_zsh_version" >&2
return 9
fi
unset min_zsh_version
# Disable color and theme in dumb terminals.
if [[ "$TERM" == 'dumb' ]]; then
zstyle ':dotzsh:*:*' color 'no'
zstyle ':dotzsh:module:prompt' theme 'off'
fi
# Load Zsh modules.
zstyle -a ':dotzsh:load' zmodule 'zmodules'
for zmodule ("$zmodules[@]") zmodload "zsh/${(z)zmodule}"
unset zmodule{s,}
# Autoload Zsh functions.
zstyle -a ':dotzsh:load' zfunction 'zfunctions'
for zfunction ("$zfunctions[@]") autoload -Uz "$zfunction"
unset zfunction{s,}
# Source files (the order matters).
source "${0:h}/helper.zsh"
# Source modules defined in ~/.zshrc.
zstyle -a ':dotzsh:load' dzmodule 'dzmodules'
dzmodload "$dzmodules[@]"
unset dzmodules