源码编译vim

获取最新版 vim 源码

1 git仓库clone

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

2, 源码包下载,里面有各个版本的vim压缩包

https://ftp.nluug.nl/pub/vim/unix/

特性解释
--with-features=huge:支持最大特性
--enable-multibyte:打开多字节支持,可以在Vim中输入中文
--enable-rubyinterp:打开对ruby编写的插件的支持
--enable-python3interp:打开对python3编写的插件的支持
--enable-perlinterp:打开对perl编写的插件的支持
--enable-luainterp:打开对lua编写的插件的支持
--enable-gui=gtk2:gtk2支持,也可以使用gnome,表示生成gvim
--enable-cscope:打开对cscope的支持
--prefix=/usr/local/vim:指定将要安装到的路径(自行创建)


自带的vim中一般没有clipboard特性,为了编译出带clipboard 的vim,
需要先安装编译vim-gui(gvim)需要的gui环境依赖头文件,可以是gtk2,gnome….等等
Fedora下用yum安装:

sudo yum install gtk2-devel.x86_64
(如果是32位的,就装gtk2-devel.i686)
接下来还要安装两个X11图形界面的源码包

sudo yum install libXt-devel.x86_64 
sudo yum install  libX11-devel.x86_64

现在可以编译vim了
进入src 目录,执行:
./configure --with-features=huge | grep gui

看是否支持 gui,如果支持,就编译、安装。
make
make install

原文:https://blog.csdn.net/XiaoApr/article/details/82837553

配置示例


卸载vim
yum -y remove vim*

安装依赖
yum -y install ncurses-devel

配置vim
./configure --with-features=huge 
            --enable-python3interp=yes 
            --prefix=/usr/local 
            --enable-fontset=yes 
            --enable-cscope=yes 
            --enable-multibyte 
            --enable-fail-if-missing 
            --enable-gui=gtk2 
#18.04 
./configure --with-features=huge  --prefix=/home/local 
            --enable-python3interp=yes --with-python3-config-dir=/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu
            

安装vim
make
make install

vim install ycm

In a Terminal, run the command:

$ sudo apt install vim-youcompleteme

Next, run the command:

$ vim-addon-manager install youcompleteme

参考文章

Joit简书
https://www.jianshu.com/p/48749100614d

https://www.cnblogs.com/shinemic/p/8409827.html

tip

The latest news about Vim can be found on the Vim home page: http://www.vim.org/
If you have problems, have a look at the Vim documentation or tips: http://www.vim.org/docs.php http://vim.wikia.com/wiki/Vim_Tips_Wiki
If you still have problems or any other questions, use one of the mailing lists to discuss them with Vim users and developers: http://www.vim.org/maillist.php
If nothing else works, report bugs directly: Bram Moolenaar Bram@vim.org

原文地址:https://www.cnblogs.com/ims-/p/10074397.html