-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
executable file
·52 lines (42 loc) · 1.27 KB
/
install.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
#!/usr/bin/env bash
IsOSX=$(uname -a | grep -i Darwin)
if [[ $IsOSX ]]; then
if [[ -z $(which realpath) ]]; then
echo "require realpath command!"
exit -1
fi
if [[ -z $(shopt | grep autocd) ]]; then
echo "require install another version of bash using brew!"
exit -1
fi
fi
VimDir=$(dirname $(realpath $0))
echo "current vim directory is: $VimDir"
if [[ -e $HOME/.vim ]]; then
echo "backup exsit .vim to .vim-bak"
rm -rf $HOME/.vim-bak
mv -f $HOME/.vim $HOME/.vim-bak
fi
if [[ -e $HOME/.vimrc ]]; then
echo "backup exsit .vimrc to .vimrc-bak"
mv -f $HOME/.vimrc $HOME/.vimrc-bak
fi
echo "create link from $VimDir to $HOME/.vim"
ln -s -f $VimDir $HOME/.vim
echo "install plugins..."
echo ""
echo "enable coc plugin?"
echo "NOTE: you should install node (version > v8) and vim (version > v8) before enable coc plugin!"
echo "you can manually enable coc plugin later by creating file plugged/enable-coc-plugin"
echo -n "so enable coc plugin right now? [y:N] "
read answ
if [[ "$answ" != "y" ]]; then
echo "will NOT intsall/load coc plugin and all nodejs plugins of coc"
else
echo "will intsall coc plugin"
mkdir -p plugged
touch plugged/enable-coc-plugin
fi
vim -c PlugUpdate
unset answ
echo "install finished!"