forked from ma6174/vim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·73 lines (60 loc) · 1.93 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
update=false
if [ -f ~/.vim/tips.md ] && [ -d ~/.vim/bundle/Vundle.vim ]; then
echo "Seems you have already installed me, update or reinstall?"
select ur in "update" "reinstall"; do
case $ur in
update ) update=true; break;;
reinstall ) break;;
esac
done
fi
if [ $update == false ]; then
echo -e "\033[31mDo you wish to remove old ~/.vim files?\033[0m"
select yn in "Yes" "No"; do
case $yn in
Yes )
echo "remove ~/.vim folder..."
rm ~/.vim -rf && mkdir -p ~/.vim
break;;
No )
echo "terminated"
exit;;
esac
done
fi
echo "Installation will take some time, please wait!"
echo 'source ~/.vim/vimrc' > ~/.vimrc
cp -rf tips.md vimrc plugin_cfg dict syntax ~/.vim/
function install_pkgs() {
for t in $*
do
dpkg -s $t >/dev/null 2>&1 || sudo apt install $t
done
}
function install_pypkgs() {
for t in $*
do
pip list 2>&1 | grep $t >/dev/null || sudo pip install $t
done
}
install_pkgs python3-pip vim vim-nox exuberant-ctags cscope git astyle
#install_pkgs build-essential cmake
#install_pkgs python-dev python3-dev libclang cmake
install_pypkgs dbgp vim-debug pep8 flake8 pyflakes isort
sudo cp kcscope-gen /usr/bin/kcscope-gen
sudo cp ucscope-gen /usr/bin/ucscope-gen
sudo cp pycscope-gen /usr/bin/pycscope-gen
echo "now installing plugins, please ignore the error of missing color scheme 'fisa'"
if [ $update == false ]; then
echo "Installing Vundle..."
git clone https://github.com/VundleVim/Vundle.vim ~/.vim/bundle/Vundle.vim
echo "Installing plugins"
vim +PluginInstall +qall
else
echo "Update plugins"
vim +PluginUpdate
fi
#echo 'install YouCompleteMe...'
#cd ~/.vim/bundle/YouCompleteMe && git submodule update --init --recursive && ./install.sh --clang-completer
echo "All done, enjoy with pow-vim!"