Install the latest Vim on CentOS 7

2017-05-26|Categories: Linux, Vim|

By yum (recommended)

yum-config-manager --add-repo \
    https://copr.fedorainfracloud.org/coprs/lantw44/vim-latest/repo/epel-7/lantw44-vim-latest-epel-7.repo

yum upgrade -y 'vim*'

See more info at https://copr.fedorainfracloud.org/coprs/lantw44/vim-latest/ .

By compilation

Install all the prerequisite libraries

yum install \
    gcc                     \
    make                    \
    ncurses-devel           \
    ctags                   \
    git                     \
    tcl-devel               \
    ruby-devel              \
    lua-devel               \
    luajit-devel            \
    python-devel            \
    python3-devel           \
    perl-devel              \
    perl-ExtUtils-ParseXS   \
    perl-ExtUtils-XSpp      \
    perl-ExtUtils-CBuilder  \
    perl-ExtUtils-Embed

Remove the existing Vim

yum list installed | grep -i vim
yum remove vim-enhanced vim-common vim-filesystem

Note: You DO NOT need to remove vim-minimal because sudo depends on it.

Download Vim's source code

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

Note: It is better to get it from GitHub because you can get all the latest patches from there.

Configuration

./configure \
    --with-features=huge            \
    --enable-multibyte              \
    --enable-rubyinterp             \
    --enable-pythoninterp           \
    --enable-perlinterp             \
    --enable-luainterp

Build

make
make install

Check Vim's version

$ vim --version | head -n2
VIM - Vi IMproved 8.1 (2018 May 18, compiled Jul 28 2018 22:07:24)
Included patches: 1-224

Leave A Comment