Skip to content

20180319_install vim 80 and youcompleteme with.html

Shawn Wang edited this page Dec 3, 2019 · 2 revisions

title: "Install the Vim 8.0 and YouCompleteMe with Make on CentOS 7.3" date: 2018-03-19 type: blog author: 凍仁翔 link: http://note.drx.tw/2018/03/install-vim-80-and-youcompleteme-with.html layout: post comments: true

As a vimmer, I want to complete and install the Vim 7.4.1578+ at /.local , so than I can use the YouCompleteMe plugin on CentOS 7.3.

▲ The Vim 8.0.1522 on CentOS 7.3.1611.

Install the Vim 8.0 with Make

1. Install the necessary package.
[ jonny@centos7 ]
$ sudo yum install gcc-c++ ncurses-devel python-devel

2. Get the source code of Vim.
[ jonny@centos7 ]
$ git clone https://github.com/vim/vim.git

3. Go to build directory.
[ jonny@centos7 ]
$ cd vim/src && git checkout v8.0.1522
# Use the version like my MacVim.

4. Configure it !
[ jonny@centos7 /vim/src ]
$ ./configure <br />    --disable-nls <br />    --enable-cscope <br />    --enable-gui=no <br />    --enable-multibyte <br />    --enable-pythoninterp <br />    --enable-rubyinterp <br />    --prefix=/home/jonny/.local/vim <br />    --with-features=huge <br />    --with-python-config-dir=/usr/lib/python2.7/config <br />    --with-tlib=ncurses <br />    --without-x
  • --prefix: For local user, not effect other users.
  • --with-python-config-dir: For support the YouCompleteMe plugin.
  • I remove --enable-perlinterp args, because it will build fail, and I don't need write the perl script.

5. Compile and install the Vim.
[ jonny@centos7 /vim/src ]
$ make && make install

6. Add /.local/vim/bin into $PATH.
[ jonny@centos7 /vim/src ]
$ vim /.bashrc
...

if [ -d "$HOME/.local/vim/bin/" ] ; then
    PATH="$HOME/.local/vim/bin/:$PATH"
fi

7. Reload the bashrc.
[ jonny@centos7 /vim/src ]
$ source /.bashrc

Install the YouCompleteMe plugin

1. Install the necessary package.
[ jonny@centos7 ]
$ sudo yum install gcc-c++ cmake python-devel

2. Get the YouCompleteMe plugin.
[ jonny@centos7 ~ ]
$ mkdir ~/.vim/bundle && <br />    git clone https://github.com/Valloric/YouCompleteMe.git <br />   /.vim/bundle/YouCompleteMe

3. Compile and install the YouCompleteMe.
[ jonny@centos7 ]
$ cd ~/.vim/bundle/YouCompleteMe && python ./install.py

Enjoy it.

By the way, I use the dein.vim to manage my vim plugins, you can see more detail at https://github.com/chusiang/vimrc .

Reference:
Native True Color Vim | O3noBLOG
Centos7 安装 vim8.0 + YouCompleteMe | nzyalj
YouCompleteMe unavailable: requires Vim compiled with Python (2.6+ or 3.3+) support | GitHub
Building Vim from source · Valloric/YouCompleteMe Wiki | GitHub
Install the Vim 8.0 and YouCompleteMe with Make on CentOS 7.3 | Chu-Siang Lai on Medium

Clone this wiki locally