编译安装vim8.0,添加python支持
Tofloor
poster avatar
aurthur
deepin
2016-09-20 22:40
Author
本帖最后由 aurthur 于 2018-8-24 15:31 编辑

刚刚装装vim从原来的7.4升级到了8.0。原先在7.4中集成的部分插件不能用了,是默认情况下8.0没有添加python支持,需要手动编译添加。

  • git clone https://github.com/vim/vim.git

先执行
vim --version | grep python查看python支持情况

图中中添加过后的,在python前“+”表示支持成功,之前python与python3前面都是“-” 。

要获得python支持,编译时得加入参数

./configure --with-features=huge --enable-python3interp --enable-pythoninterp --with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu/ --enable-rubyinterp --enable-luainterp --enable-perlinterp --with-python3-config-dir=/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu/ --enable-multibyte --enable-cscope      --prefix=/usr/local/vim/
参数说明如下:

--with-features=huge:支持最大特性
--enable-rubyinterp:打开对ruby编写的插件的支持
--enable-pythoninterp:打开对python编写的插件的支持
--enable-python3interp:打开对python3编写的插件的支持
--enable-luainterp:打开对lua编写的插件的支持
--enable-perlinterp:打开对perl编写的插件的支持
--enable-multibyte:打开多字节支持,可以在Vim中输入中文
--enable-cscope:打开对cscope的支持
--with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu/ 指定python 路径
--with-python-config-dir=/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu/指定python3路径

--prefix=/usr/local/vim:指定将要安装到的路径(自行创建)

如果出现问题请自得安装python-dev 再执行上面命令

sudo apt-get install python-dev

sudo apt-get install python3-dev

sudo apt-get install libncurses5-dev

之后 sudo make && make install 即可成功添加python支持

  • git clone https://github.com/vim/vim.git


Reply Favorite View the author
All Replies
daniel--di
deepin
2016-09-20 23:59
#1
赞一个,我也是前几天装好的8.0
Reply View the author
shitouge
deepin
2016-10-17 00:05
#2
我按你的步骤做的,还是没解决Python的支持问题

Reply View the author
hxpsd2014
deepin
2016-10-17 18:25
#3
http://www.jianshu.com/p/b7ed09c90082看看这个吧,很详细
Reply View the author
aurthur
deepin
2016-11-17 06:44
#4
https://bbs.deepin.org/post/43716
我按你的步骤做的,还是没解决Python的支持问题

现在解决了吗?
Reply View the author
135******85
deepin
2016-11-17 14:29
#5
搞复杂了。我也试着编译了,显示支持Python了,可惜插件youcompleteme还是不认。
然后我卸载了自己编译的,直接在深度商店安装,直接就是vim8.0,并且完美支持Youcompleteme插件。
Reply View the author
bobo
deepin
2016-11-17 15:04
#6
为啥我用 apt policy vim 查到的还是7.4 阿?
Reply View the author
aurthur
deepin
2016-11-17 16:11
#7
https://bbs.deepin.org/post/43716
为啥我用 apt policy vim 查到的还是7.4 阿?

源里还没有更新
Reply View the author
vic
deepin
2017-09-03 00:29
#8
https://bbs.deepin.org/post/43716
搞复杂了。我也试着编译了,显示支持Python了,可惜插件youcompleteme还是不认。
然后我卸载了自己编译的, ...

深度商店下那个???
Reply View the author