-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.sh
executable file
·58 lines (43 loc) · 1.06 KB
/
init.sh
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
57
58
#!/bin/zsh
system=${$(uname):l}
if [[ -z $ZSH_VERSION ]]; then
echo 'This script needs zsh.' >&2
exit 1
fi
setopt extended_glob
cd `dirname $0`
src=${$(pwd)#$HOME/}
# Linking all dotfiles/dotfolders
for i in (.*~.git*~.*.swp); do
echo "Linking $i"
rm -rf $HOME/$i
ln -s $src/$i $HOME/
done
mkdir -p ~/.config/nvim
ln -s $src/.vim/init.lua ~/.config/nvim/init.lua
# Set up tmux
tmux=$HOME/.tmux.conf
rm -f $tmux
echo 'Linking tmux configuration'
if [[ -f .tmux/$system.conf ]]; then
ln -s .tmux/$system.conf $tmux
else
ln -s .tmux/common.conf $tmux
fi
# Set up zsh
echo 'Setting up local zshrc'
if [[ ! -f $HOME/.zshrc.local ]]; then
echo . $HOME/.zsh/$system > $HOME/.zshrc.local
fi
# Vim plugins
plug=".vim/autoload/plug.vim"
if [[ ! -f $plug ]]; then
mkdir -p $(dirname $plug)
curl 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' > $plug
fi
for vim in vim nvim; do
if whence -p $vim >/dev/null; then
echo "Installing plugins in $vim"
$vim -u NONE -c "so $plug | so .vim/plugins.vim | PlugInstall | qa"
fi
done