-
Notifications
You must be signed in to change notification settings - Fork 1
/
zshrc
56 lines (45 loc) · 1.42 KB
/
zshrc
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
47
48
49
50
51
52
53
54
55
56
#!/bin/zsh
if [ -z "${DOTFILES:-}" ]; then
DOTFILES=~/.dotfiles
fi
# install
if [ ! -e ~/.config ]; then mkdir ~/.config; fi
if [ ! -e ~/.vimbackup ]; then mkdir ~/.vimbackup; fi
if [ ! -e ~/.vimrc ]; then
echo "set runtimepath+=${DOTFILES}/vim" > ~/.vimrc
echo "source ${DOTFILES}/vimrc" >> ~/.vimrc
fi
if [ ! -e ~/.gitconfig ]; then
ln -s ${DOTFILES}/git/config ~/.gitconfig
fi
if command -v alacritty >/dev/null && [ ! -e ~/.config/alacritty ]; then
mkdir ~/.config/alacritty
for file in colors-dark.toml colors-light.toml switchcolors.sh; do
ln -s ${DOTFILES}/alacritty/$file ~/.config/alacritty/$file
done
printf 'import = ["%s/alacritty/alacritty.toml", "%s/.config/alacritty/colors.toml"]' "${DOTFILES}" "${HOME}" > ~/.config/alacritty/alacritty.toml
if [ ! -e ~/.config/alacritty/colors.toml ]; then ln -s colors-dark.toml ~/.config/alacritty/colors.toml; fi
fi
fpath=(~/.zsh.d/site-functions $fpath)
fpath=(~/.dotfiles-local/zsh.d/site-functions $fpath)
if [ -e ~/.zshrc.local ]; then
source ~/.zshrc.local
fi
# load config
for config_file (${DOTFILES}/zsh.d/*.zsh); do
source $config_file
done
# local overrides
if [ -e ~/.dotfiles-local/zsh.d ]; then
for config_file (~/.dotfiles-local/zsh.d/*.zsh); do
source $config_file
done
fi
if [ -e ~/.zsh.d ]; then
for config_file (~/.zsh.d/*.zsh); do
source $config_file
done
fi
if [ -e ~/.dotfiles-local/zshrc.late ]; then
source ~/.dotfiles-local/zshrc.late
fi