Skip to content

Commit 84c1c5b

Browse files
author
gaopengfei01
committed
Merge remote-tracking branch 'upstream/master'
2 parents c9ae29d + ea0d67f commit 84c1c5b

File tree

3 files changed

+52
-9
lines changed

3 files changed

+52
-9
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,11 @@ An automatic configuration program for vim
203203
<td width="20%"><a href="https://github.com/urain39"><img src="https://avatars2.githubusercontent.com/u/16981964?s=400&v=4"/></a><p align="center">urain39</p></td>
204204
<td width="20%"><a href="https://github.com/freedomDR"><img src="https://avatars3.githubusercontent.com/u/11146756?s=400&v=4"/></a><p align="center">freedomDR</p></td>
205205
<td width="20%"><a href="https://github.com/starifly"><img src="https://avatars2.githubusercontent.com/u/2003879?s=400&v=4"/></a><p align="center">starifly</p></td>
206+
</tr>
207+
<tr>
208+
<td width="20%"><a href="https://github.com/Shaloc"><img src="https://avatars2.githubusercontent.com/u/24523674?s=400&v=4"/></a><p align="center">Shaloc</p></td>
209+
<td width="20%"><a href="https://github.com/jokerkeny"><img src="https://avatars2.githubusercontent.com/u/10593391?s=400&v=4"/></a><p align="center">jokerkeny</p></td>
210+
</tr>
206211
</table>
207212
208213

install.sh

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@ function is_ubuntu1604()
3131
fi
3232
}
3333

34+
35+
# 判断是否是Debian版本
36+
function is_debian()
37+
{
38+
version=$(lsb_release -is)
39+
if [ "${version}" == "Debian" ]; then
40+
echo 1
41+
else
42+
echo 0
43+
fi
44+
}
45+
3446
# 在ubuntu上源代码安装vim
3547
function compile_vim_on_ubuntu()
3648
{
@@ -114,15 +126,20 @@ function install_prepare_software_on_centos()
114126
# 安装ubuntu发行版必要软件
115127
function install_prepare_software_on_ubuntu()
116128
{
117-
sudo apt-get install -y ctags build-essential cmake python-dev python3-dev fontconfig curl libfile-next-perl ack-grep
129+
sudo apt-get update
130+
sudo apt-get install -y ctags build-essential cmake python python-dev python3-dev fontconfig curl libfile-next-perl ack-grep
118131
ubuntu_1604=`is_ubuntu1604`
132+
debian=`is_debian`
119133
echo ${ubuntu_1604}
120134

121135
if [ ${ubuntu_1604} == 1 ]; then
122-
echo "ubuntu 16.04 LTS"
136+
echo "Ubuntu 16.04 LTS"
137+
compile_vim_on_ubuntu
138+
elif [ ${debian} == 1 ]; then
139+
echo "Debian"
123140
compile_vim_on_ubuntu
124141
else
125-
echo "not ubuntu 16.04 LTS"
142+
echo "Not ubuntu 16.04 LTS"
126143
sudo apt-get install -y vim
127144
fi
128145
}
@@ -189,13 +206,33 @@ function compile_ycm_on_linux()
189206
./install.py --clang-completer
190207
}
191208

192-
# mac编译ycm插件
193-
function compile_ycm_on_mac()
209+
# macos编译ycm, 原始方法
210+
function compile_ycm_on_mac_legacy()
194211
{
195212
cd ~/.vim/plugged/YouCompleteMe
196213
./install.py --clang-completer --system-libclang
197214
}
198215

216+
# macos编译ycm, Mojave上的方法
217+
function compile_ycm_on_mac_mojave()
218+
{
219+
echo "Installing macOS_10.14 sdk headers..."
220+
xcode-select --install
221+
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
222+
cd ~/.vim/plugged/YouCompleteMe
223+
./install.py --clang-completer
224+
}
225+
226+
# 在MacOS上编译ycm
227+
function compile_ycm_on_mac()
228+
{
229+
mac_version=$(sw_vers | grep ProductVersion | cut -d '.' -f 2 -f 3)
230+
fix_macos_version_list=(14.1 14.2 14.3 14.4)
231+
echo "${fix_macos_version_list[@]}" | grep -wq "$mac_version" && \
232+
compile_ycm_on_mac_mojave || \
233+
compile_ycm_on_mac_legacy
234+
}
235+
199236
# 打印logo
200237
function print_logo()
201238
{
@@ -263,7 +300,7 @@ function install_vimplus_on_archlinux()
263300
function install_vimplus_on_linux()
264301
{
265302
type=`get_linux_platform_type`
266-
echo "linux platform type: "${type}
303+
echo "Linux platform type: "${type}
267304

268305
if [ ${type} == "ubuntu" ]; then
269306
install_vimplus_on_ubuntu
@@ -272,22 +309,22 @@ function install_vimplus_on_linux()
272309
elif [ ${type} == "archlinux" ]; then
273310
install_vimplus_on_archlinux
274311
else
275-
echo "not support this linux platform type: "${type}
312+
echo "Not support this linux platform type: "${type}
276313
fi
277314
}
278315

279316
# main函数
280317
function main()
281318
{
282319
type=`get_platform_type`
283-
echo "platform type: "${type}
320+
echo "Platform type: "${type}
284321

285322
if [ ${type} == "Darwin" ]; then
286323
install_vimplus_on_mac
287324
elif [ ${type} == "Linux" ]; then
288325
install_vimplus_on_linux
289326
else
290-
echo "not support platform type: "${type}
327+
echo "Not support platform type: "${type}
291328
fi
292329
}
293330

0 commit comments

Comments
 (0)