Vim 8.0
安装Vim 8.0
yum install ncurses-devel
wget https://github.com/vim/vim/archive/master.zip
unzip master.zip
cd vim-master
cd src/
./configure
make
sudo make install
vim
注:make clean仅仅是清除之前编译的可执行文件及配置文件,而make distclean要清除所有生成的文件。
注:编译安装vim8.0,添加python支持 不能同时支持二者
获得python支持,编译时得加入参数
./configure
--with-features=huge --enable-python3interp --enable-pythoninterp
--with-python-config-dir=/usr/lib64/python2.7/config/ --enable-rubyinterp
--enable-luainterp --enable-perlinterp
--with-python3-config-dir=/usr/lib/python3.5/config-3.5m-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/lib64/python2.7/config 指定python config路径
--with-python-config-dir=/usr/lib/python3.5/config-3.5m-x86_64-linux-gnu/ 指定python3 config路径
--prefix=/usr/local/vim:指定将要安装到的路径(自行创建)
对perl组件支持的问题
在编译perl组件支持时,出现如下错误:
/bin/perl -e 'unless ( $] >= 5.005 ) { for (qw(na defgv errgv)) { print "#define PL_$_ $_\n" }}' > auto/if_perl.c
/bin/perl /usr/share/perl5/ExtUtils/xsubpp -prototypes -typemap \
/usr/share/perl5/ExtUtils/typemap if_perl.xs >> auto/if_perl.c
Can't open perl script "/usr/share/perl5/ExtUtils/xsubpp": No such file or directory
Makefile:2453: recipe for target 'auto/if_perl.c' failed
make[1]: *** [auto/if_perl.c] Error 2
make[1]: Leaving directory '/home/$usr/vim/src/vim74/src'
Makefile:26: recipe for target 'first' failed
make: *** [first] Error 2
解决:
yum install perl-ExtUtils*
找了下,发现perl5的$lib路径和原先系统的竟然不一样了,在$PELR5/vendor_perl/ExtUtil/中才有连接文件xsubpp。
接着修改了编译的指向路径,接着编译,却报错:
objects/buffer.o: In function `free_buffer':
/home/$usr/vim/src/vim74/src/buffer.c:661: undefined reference to `perl_buf_free'
objects/ex_docmd.o:(.rodata+0x4678): undefined reference to `ex_perl'
objects/ex_docmd.o:(.rodata+0x4690): undefined reference to `ex_perldo'
objects/window.o: In function `win_free':
/home/$usr/vim/src/vim74/src/window.c:4554: undefined reference to `perl_win_free'
objects/main.o: In function `getout':
/home/$usr/vim/src/vim74/src/main.c:1488: undefined reference to `perl_end'
collect2: error: ld returned 1 exit status
link.sh: Linking failed
Makefile:1733: recipe for target 'vim' failed
make[1]: *** [vim] Error 1
make[1]: Leaving directory '/home/$USR/vim/src/vim74/src'
Makefile:26: recipe for target 'first' failed
make: *** [first] Error
检查src/auto/中的if_perl.c文件,发现竟然是空得,生成失败了。
根据makefile或者第一个报错的指引,找到生成if_perl.c的命令,手动生成即可:
/bin/perl -e 'unless ( $] >= 5.005 ) { for (qw(na defgv errgv)) { print "#define PL_$_ $_\n" }}' > auto/if_perl.c
/bin/perl /usr/share/perl5/ExtUtils/xsubpp -prototypes -typemap \
/usr/share/perl5/ExtUtils/typemap if_perl.xs >> auto/if_perl.c
注意xsubpp的路径。
如果出现问题请安装python-dev 再执行上面命令
sudo yum install python-dev
sudo yum install python3-dev
sudo yum install libncurses5-dev
确保 vim 支持 python 2/3 脚本

从上图可以看出老夫的 vim 版本是 8.0.49 且支持 python3 脚本但不支持 python2 脚本(截图的倒数第 7,8 行)
如果你的打印结果中没有相关 python 脚本信息,还可以在 vim 中键入命令 :echo has('python') || has('python3')
,若结果是 1 则证明是支持的。
若不论是 vim 版本不满足条件或者是不支持 python 脚本,那么就需要从源码编译安装 vim 了,
Vim 8.0的更多相关文章
- Mac OS 上 VIM 8.0 安装体验
VIM 8.0 赶在中秋前发布 The best way to install Vim on Unix is to use the sources. This requires a compiler ...
- Centos 6.5(64位) vim 8.0 安装
转自:https://blog.csdn.net/sdoyuxuan/article/details/78825912 1 先得安装nurses库 yum list | grep "ncur ...
- Vim 8.0 版本安装方法及添加Python支持
利用Git安装 最简单也是最有效的方法 1. 获取Vim仓库: git clone https://github.com/vim/vim.git 2. 升级到最新的版本: cd vim git pul ...
- Installing Vim 8.0 on Ubuntu 16.04 and Linux Mint 18
sudo add-apt-repository ppa:jonathonf/vim sudo apt update sudo apt install vim uninstall sudo apt re ...
- 代码编辑器[0] -> Vim/gVim[0] -> 基于 Python 的 gVim 环境配置(Windows)
环境配置 / Environment Setup 基于Python开发的 gVim 环境配置(Windows) 使用方式参考 Vim 的使用. 1 基于vundle进行配置 Vim有多个扩展管理器, ...
- Linux Vim编辑器使用简单讲解
在Linux中,主要编辑器为vi或者vim,本文围绕vim做简单的讲解说明:Linux默认自带vi(vim)编辑器,其程序包为:[root@linuxidc.com ~]# rpm -qf `whic ...
- PARSEC-3.0编译错误
OS: Ubuntu 14.04 LTS (x86_64) ***error 1 OpenSSL 1.0.1e 与 perl5.18 不兼容 POD document had syntax error ...
- vim深入研究
About VIM--Unix及类Unix系统文本编辑器 Vim是一个类似于Vi的著名的功能强大.高度可定制的文本编辑器,在Vi的基础上改进和增加了很多特性.VIM是纯粹的自由软件. Vim普遍被推崇 ...
- vi/vim使用进阶: vimrc初步
本节所用命令的帮助入口: :help compatible :help mapleader :help map :help autocmd 当vim在启动时,如果没有找到vimrc或gvimrc,它缺 ...
随机推荐
- Prometheus监控学习笔记之教程推荐
最近学习K8S和基于容器的监控,发现了如下的教程质量不错,记录下来以备参考 1. K8S最佳实战(包括了K8S的Prometheus监控和EFK日志搜集) https://jimmysong.io/k ...
- android 颜色值参考,(有颜色图
) 2011-10-13 19:55:30| 分类: android | 标签:android颜色值|字号大中小 订阅 Android 常用RGB值以及中英文名称 颜 色 RGB值 英文名 中文名 ...
- PHP命名空间(Namespace)的使用简介
原文链接:https://www.cnblogs.com/zhouguowei/p/5200878.html 可以导入命名空间也可以导入命名空间的类 <?php namespace Blog\A ...
- host文件的作用
什么是host文件 Hosts是一个没有扩展名的系统文件,其基本作用就是将一些常用的网址域名与其对应的IP地址建立一个关联“数据库”,当用户在浏览器中输入一个需要登录的网址时,系统会首先自动从Host ...
- 【Python022--递归】
一.递归 1.写一个求阶乘的函数 --正整数阶乘指从1乘以2乘以3乘以4一直乘到所要求的数 --普通的代码编写方式: def factorial(n): result = n for i ...
- 关于link标签的用法, 不声明rel=stylesheet则无效? 在ff中必须声明rel属性!
void 无效的, 空的; invalid: 无效的, void 和 invalid 在表示无效的时候, 是一样的, 等同的 the treaty (条约) was declared invalid ...
- POJ1741 Tree(树分治——点分治)题解
题意:给一棵树,问你最多能找到几个组合(u,v),使得两点距离不超过k. 思路:点分治,复杂度O(nlogn*logn).看了半天还是有点模糊. 显然,所有满足要求的组合,连接这两个点,他们必然经过他 ...
- iframe初始化属性
<iframe id="user" src="xxx.html" frameborder="0" width="" ...
- [java变量] - 字符串数组转long型数组
//定义字符串 String str = "1,3,6,9,4,2,1,6"; //截取字符串 String[] strArr = str.split(",") ...
- c# 重试机制
protected async Task<T> TryOperation<T>(int maxRetryCount,Func<Task<T>> func ...