forked from TTWShell/legolas-vim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-plugins.sh
executable file
·63 lines (52 loc) · 1.4 KB
/
install-plugins.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
function install {
ln -s -f `pwd`/vimrc $HOME/.vimrc
touch $HOME/.vimrc.local
yes "" | vim +PlugClean +qall
yes "" | vim +PlugInstall +qall
}
function update {
yes "" | vim +PlugUpdate +qall
yes "" | vim +PlugUpgrade +qall
}
function init {
echo ">>> Set up plug.vim ..."
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
sudo pip install flake8 # for vim-flake8
install
mkdir -p ~/.vim/colors && cp ~/.vim/plugged/vim-colorschemes/colors/* ~/.vim/colors
rebuild --gocode-completer
}
function rebuild() {
cd ~/.vim/plugged/YouCompleteMe && git submodule update --init --recursive && ./install.py "$@"
}
function usage {
printf "Usage:\n"
printf " init\t初始化安装插件\n"
printf " install\t安装新增变更配置\n"
printf " update\t更新配置且更新所有插件。可能会导致ycm不能正常工作,此时需要执行 rebuild 命令\n"
printf " rebuild\trebuild YouCompleteMe。可加YCM build的参数,例如:--clang-completer --gocode-completer\n"
}
Action=$1
shift
case "$Action" in
init)
init "$@"
;;
update)
install
update
;;
install)
install
;;
rebuild)
rebuild "$@"
;;
*)
usage
exit 1
;;
esac
exit 0