最近在编译YouCompleteMe的时候发现一个问题,因为其需要Vim版本较高,所以我安装vim8.0,根据网上教程进行安装的时候出现问题,
下面是官网的安装方法连接 https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source
有一个注意点:
Note: If you are using Python, your config directory might have a machine-specific name (e.g. config-3.5m-x86_64-linux-gnu). Check in /usr/lib/python[2/3/3.5] to find yours, and change the python-config-dir and/or python3-config-dir arguments accordingly.
Note for Ubuntu users: You can only use Python 2 or Python 3. If you try to compile vim with both python-config-dir and python3-config-dir, YouCompleteMe will give you an error YouCompleteMe unavailable: requires Vim compiled with Python (2.6+ or 3.3+) support, when you start VIM.
大概就是说用ubuntu的话,只能讲Python2和python3编译一个,不然就会报错,“requires Vim compiled with Python (2.6+ or 3.3+) support”,
所以我重新编译的时候 在 vim/src下的makefile中直接 将
447 # Build two separate versions of Vim in that case.
448 CONF_OPT_PYTHON = --enable-pythoninterp
449 #CONF_OPT_PYTHON = --enable-pythoninterp=dynamic
450 #CONF_OPT_PYTHON3 = --enable-python3interp
451 #CONF_OPT_PYTHON3 = --enable-python3interp=dynamic
做如上操作,然后make 再make install操作。
发现 vim后还是有提示,requires Vim compiled with Python (2.6+ or 3.3+) support。
找了好久才发现,原来还要将 /usr/local/bin/vim sudo cp 到 /usr/bin/vim 下,这才ok!