-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_zshrc
More file actions
25 lines (22 loc) · 872 Bytes
/
Copy pathdot_zshrc
File metadata and controls
25 lines (22 loc) · 872 Bytes
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
# .zshrc — ローダー。実体は ~/.config/zsh/rc.d/*.zsh に機能別分割されている。
# in ~/.zshenv, executed `unsetopt GLOBAL_RCS` and ignored /etc/zshrc
if [[ "$(uname)" == "Darwin" ]]; then
[ -r /etc/zshrc ] && . /etc/zshrc
fi
# rc.d モジュールを番号順に: stale なら zcompile してから source する。
# 依存順: 10-path(FPATH) -> 30-plugins(compinit) -> 40-tools(bashcompinit 後の complete -C)
ZSH_RCD="${XDG_CONFIG_HOME:-$HOME/.config}/zsh/rc.d"
if [[ -d $ZSH_RCD ]]; then
for _rc in "$ZSH_RCD"/*.zsh(N); do
if [[ ! -f ${_rc}.zwc || ${_rc} -nt ${_rc}.zwc ]]; then
zcompile "$_rc"
fi
source "$_rc"
done
unset _rc ZSH_RCD
fi
# .zshrc 自身の再コンパイル
if [[ ! -f $HOME/.zshrc.zwc || $HOME/.zshrc -nt $HOME/.zshrc.zwc ]]; then
print -P "%F{34}Recompile .zshrc%f%b"
zcompile "$HOME/.zshrc"
fi