为什么要源码编译安装VIM?
因为我要安装ycm,ycm要求vim版本为8.0
教程步骤:
1, 核对系统版本
2, 删除系统自带的vim
3, 编译安装vim
4, 检验vim的安装
1,核对系统版本
root@Linux:~# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04.5 LTS Release: 14.04 Codename: trusty root@Linux:~#
系统版本不是Ubuntu 14.05的少年,请不要往下看了
2,删除系统自带的vim
查看当前vim编辑器版本 root@Linux:~# which vim /usr/bin/vim root@Linux:~# vim --version VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 24 2016 16:43:18) 删除系统的vim root@Linux:~# apt-get autoremove vim 验证vim是否删除 root@Linux:~# vim bash: /usr/bin/vim: 没有那个文件或目录 root@Linux:~# which vim root@Linux:~#
3,编译安装vim
解决依赖 python 开发库 root@Linux:~# apt-get install python-dev 下载vim源代码 root@Linux:~# wget https://codeload.github.com/vim/vim/zip/master root@Linux:~# unzip master root@Linux:~# cd vim-master/ 开始configure root@Linux:~/vim-master# ./configure --enable-pythoninterp=yes -with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu/ 报错提示: no terminal library found checking for tgetent()... configure: error: NOT FOUND! You need to install a terminal library; for example ncurses. Or specify the name of the library with --with-tlib. 解决: root@Linux:~/vim-master# apt-get install -y libncurses5-dev 继续configure: root@Linux:~/vim-master# ./configure --enable-pythoninterp=yes -with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu/ root@Linux:~/vim-master# echo $? 0 编译: root@Linux:~/vim-master# make -j 8 root@Linux:~/vim-master# echo $? 0 安装vim root@Linux:~/vim-master# make install root@Linux:~/vim-master# echo $? 0
4, 检验vim的安装
root@Linux:~/vim-master# vim bash: /usr/bin/vim: 没有那个文件或目录 root@Linux:~/vim-master# which vim /usr/local/bin/vim 创建软链接 root@Linux:~/vim-master# ln -s /usr/local/bin/vim /usr/bin/vim 验证版本 root@Linux:~/vim-master# vim --version VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Mar 4 2017 15:12:25) 包含补丁: 1-329 编译者 root@Linux 验证vim-python插件 root@Linux:~/vim-master# vim --version | grep python +cryptv +linebreak +python +vreplace +cscope +lispindent -python3 +wildignore
到此VIM 8.0安装成功!
本文出自 “魂斗罗” 博客,请务必保留此出处http://990487026.blog.51cto.com/10133282/1903196
原文地址:http://990487026.blog.51cto.com/10133282/1903196