-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy.sh
executable file
·126 lines (118 loc) · 2.78 KB
/
deploy.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#!/bin/bash
# Deploy Vim configuration
echo
echo
echo "*** Begin Vim config deployment ***"
echo
echo "...determining operating system."
echo
os_system=$OSTYPE
if [[ $os_system == "darwin"* ]]
then
echo "You're using a Mac computer."
fi
if [[ $os_system == "linux"* ]]
then
echo "You're using a Linux computer."
fi
echo
echo
echo "------ Update Vim & dependencies------"
echo
# Update for Mac
if [[ $os_system == "darwin"* ]]
then
versionNumber="$(vim --version | awk 'NR==1 { print $5 }')"
if [[ $versionNumber > 8.0 ]]
then
echo
echo "Vim is up to date."
echo
else
git clone https://github.com/vim/vim.git
cd vim/src
make
sudo make install
fi
fi
# Update for Linux
if [[ $os_system == "linux"* ]]
then
versionNumber="$(vim --version | awk 'NR==1 { print $5 }')"
if [[ $versionNumber > 8.0 ]]
then
echo
echo "Vim is up to date."
echo
else
cd ~
sudo apt -y remove vim vim-runtime gvim
sudo apt -y install build-essential cmake python3-dev
sudo apt-get -y install libncurses5-dev libncursesw5-dev
git clone https://github.com/vim/vim.git
cd ~/vim
./configure --with-features=huge \
--enable-multibyte \
--enable-rubyinterp=yes \
--enable-python3interp=yes \
--with-python3-config-dir=/usr/lib/python3.5/config \
--enable-perlinterp=yes \
--enable-luainterp=yes \
--enable-gui=gtk2 \
--enable-cscope \
--prefix=/usr/local
make VIMRUNTIMEDIR=/usr/local/share/vim/vim81
cd ~/vim
make
sudo make install
fi
fi
echo
echo "------ Vim Updated ------"
echo
echo
# Check if Vundle is installed
if [ -e ~/.vim/bundle/Vundle.vim ]
then
echo "Vundle is installed."
else
if [ ! -d ~/.vim ]
then
mkdir -p ~/.vim/bundle
# Clone Vundle Package
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
fi
if [ ! -d ~/.vim/bundle ]
then
mkdir ~/.vim/bundle
# Clone Vundle Package
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
fi
fi
if [ ! -e ~/.vimrc ]
then
# Create symbolic link
ln -s ~/.vim/vimrc ~/.vimrc
else
echo ".vimrc already exists, remove to create system link"
echo "Use command 'ln -s ~/.vim/vimrc ~/.vimrc'"
fi
echo
vim +PluginInstall +qall
cd ~/.vim/bundle/youcompleteme
python3 install.py
echo
echo
echo "Finished installing Vim plugins."
echo
echo "********** DEPLOYMENT COMPLETED **********"
echo
echo "Brought to you by: "
echo "
_____ ____ _
| __ \ | _ \ _ | |
| |__) | | |_) | _| |_ | |
| ___/ | _ < |_ _| | |
| | | |_) | |_| | |____
|_| |____/ |______|
"