zshrc 759 Bytes
Newer Older
1
2
# We need to enable extended globbing here for the below source inclusion
setopt EXTENDED_GLOB
Nigel Kukard's avatar
Nigel Kukard committed
3
4

# Source in resources
Nigel Kukard's avatar
Nigel Kukard committed
5
find "$HOME"/.zsh/zshrc{,_local}.d -type f -name "*.zsh" | sort -t/ -k6,6 | while read LINE; do
Robert Spencer's avatar
Robert Spencer committed
6
7
	# If there's a file in zshrc_local.d with the same name as one
	# in zshrc.d, ignore the file in zshrc.d
8
	if [[ "$LINE" =~ "zshrc.d" && -e "$HOME/.zsh/zshrc_local.d/${LINE:t}" ]] ; then
Robert Spencer's avatar
Robert Spencer committed
9
10
11
12
13
		# Do nothing
		:
	else
		source "$LINE"
	fi
Nigel Kukard's avatar
Nigel Kukard committed
14
15
done

Robert Spencer's avatar
Robert Spencer committed
16
17
18
19
# NB: Note that precedence matters, so some settings will not yield the
# expected results when put into ~/.zsh/zshrc.local. In that case you need
# to figure out the file number and put it into ~/.zsh/zshrc_local.d/

Nigel Kukard's avatar
Nigel Kukard committed
20
21
22
23
24
# Source in local stuff
if [ -f ~/.zsh/zshrc.local ]
then
	source ~/.zsh/zshrc.local
fi