Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Compile the latest Vim 7.4 on CentOS 7
Compile the latest Vim 7.4 on CentOS 7
# yum install gcc make ncurses ncurses-devel
# yum install ruby ruby-devel lua lua-devel luajit \
luajit-devel ctags git python python-devel \
python3 python3-devel tcl-devel \
perl perl-devel perl-ExtUtils-ParseXS \
perl-ExtUtils-XSpp perl-ExtUtils-CBuilder \
perl-ExtUtils-Embed
or
# yum clean all
# yum grouplist
# yum groupinfo "Development Tools"
# yum groupinstall "Development tools"
# yum install ncurses ncurses-devel
// For debian/Ubuntu users:
# apt-get install libncurses5-dev libgnome2-dev libgnomeui-dev \
libgtk2.0-dev libatk1.0-dev libbonoboui2-dev \
libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev \
python3-dev ruby-dev git
If you want to install the optional packages With yum groupinstall command:
# vim /etc/yum.conf
group_package_types=default, mandatory, optional
Note: the default setting is default, mandatory.
Remove the existing vim if you have already installed it:
# yum list installed | grep -i vim
vim-common.x86_64 2:7.4.160-1.el7 @base
vim-enhanced.x86_64 2:7.4.160-1.el7 @base
vim-filesystem.x86_64 2:7.4.160-1.el7 @base
vim-minimal.x86_64 2:7.4.160-1.el7 @anaconda
# yum remove vim-enhanced vim-common vim-filesystem
Note: You do not need to remove vim-minimal because sudo depends on it.
Build vim:
# cd /usr/local/src
Download vim source (it is better to get it from GitHub because you can get all the latest patches from there):
# git clone https://github.com/vim/vim.git
# cd vim
or
# wget ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2
# tar -xjf vim-7.4.tar.bz2
# cd vim74
Show the configuration options:
# ./configure --help
Configure:
# ./configure --prefix=/usr --with-features=huge --enable-multibyte --enable-rubyinterp --enable-pythoninterp --enable-perlinterp --enable-luainterp
Build:
# make
or
# make VIMRUNTIMEDIR=/usr/share/vim/vim74
# make install
re-hash the environment:
# hash -r
Check vim version:
# vim --version | less
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jul 24 2016 14:27:26)
Included patches: 1-2102
...
+lua +multi_byte +perl +python +ruby
Check vim patches:
# vim
:echo has("patch-7.4-2102")
1
Reference:
http://www.vim.org/git.php
https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source
https://gist.github.com/holguinj/11064609
http://www.fullybaked.co.uk/articles/installing-latest-vim-on-centos-from-source
@tommyjcarpenter

This comment has been minimized.

Copy link

@tommyjcarpenter tommyjcarpenter commented Oct 24, 2017

This seems incomplete. On CentOS Linux release 7.4.1708 (Core) In the first command I get:

Loaded plugins: fastestmirror, langpacks, priorities
Loading mirror speeds from cached hostfile
 * base: up2date.research.att.com
 * extras: up2date.research.att.com
 * updates: up2date.research.att.com
Package ruby-2.0.0.648-30.el7.x86_64 already installed and latest version
Package lua-5.1.4-15.el7.x86_64 already installed and latest version
No package luajit available.
No package luajit-devel available.
Package ctags-5.8-13.el7.x86_64 already installed and latest version
Package git-1.8.3.1-12.el7_4.x86_64 already installed and latest version
Package python-2.7.5-58.el7.x86_64 already installed and latest version
Package python-devel-2.7.5-58.el7.x86_64 already installed and latest version
No package python3 available.
No package python3-devel available.
Package 1:tcl-devel-8.5.13-8.el7.x86_64 already installed and latest version
Package 4:perl-5.16.3-292.el7.x86_64 already installed and latest version
Package 4:perl-devel-5.16.3-292.el7.x86_64 already installed and latest version
Package 1:perl-ExtUtils-ParseXS-3.18-3.el7.noarch already installed and latest version
No package perl-ExtUtils-XSpp available.
Package 1:perl-ExtUtils-CBuilder-0.28.2.6-292.el7.noarch already installed and latest version
Package perl-ExtUtils-Embed-1.30-292.el7.noarch already installed and latest version
Resolving Dependencies

The "no package available"s are the concern for compiling vim with python support.

EDIT: I was able to use the stuff after "or" which did seem to work. Thanks for this guide!

EDIT2: hash is not a command on my vanilla centos7.4 system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment