-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·64 lines (46 loc) · 1.29 KB
/
bootstrap.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
59
60
61
62
63
#!/usr/bin/env bash
BACKUPDIR=${HOME}/.dotfiles.bak
_has(){
command type "${1}" > /dev/null 2>&1
}
_die(){
>&2 echo "$@"
exit 1
}
_backup(){
mkdir -p ${BACKUPDIR}
for f in ${HOME}/.zshrc* ${HOME}/.vim* ${HOME}/.i3* ${HOME}/.tmux* ${HOME}/.zplug*; do
mv -vf ${f} ${BACKUPDIR}/ 2>/dev/null
done
}
_deploy(){
# deploy dotfiles with stow
printf "\nRestow dotfiles\n"
for d in $(find . -mindepth 1 -maxdepth 1 ! -path ./.git ! -path i3-hibernate -type d -printf "%f\n"); do
stow -v -R ${d} -d . -t ~
done
}
_caveat(){
cat <<_EOL_
- i3-hibernate requries root permisions
sudo rsync -rvzh i3-hibernate/ /
- Install antibody
curl -sL git.io/antibody | sh -s
- Install vim-plug on vim
mkdir -p ~/.vim/autoload;
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
- Install vim-plug on neovim
mkdir -p ~/.config/nvim/;
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
- Install all plugins automatically:
vim +PlugInstall +qall
_EOL_
}
##
if ! _has "stow"; then
_die '"stow" not found, you need to install stow'
fi
rm -fv ${HOME}/.zcompdump*
# _backup
_deploy
_caveat