Skip to content
Alex Hoffman edited this page Apr 14, 2020 · 3 revisions

TODO: VIM Vim usage screenshot

YouCompleteMe Integration

This is not really related to the project but as I have left in the YCM symlinks and options in the CMake I may as well detail the YouCompleteMe Vim integration as it is applicable for other projects as well.

Install vim-plug

Ubuntu users

Ubuntu does not yet install vim 8.X+ by default and as you must install it manually first

sudo add-apt-repository ppa:jonathonf/vim
sudo apt update
sudo apt install vim

Installation

Prerequisites

A python version >= 3.5 is required.

sudo apt install build-essential cmake3 python3.5-dev python3.5
Vim plugin manager
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
YCM

Add YCM to vimrc

echo "call plug#begin('~/.vim/plugged')" >> $HOME/.vimrc
echo "Plug 'valloric/youcompleteme'" >> $HOME/.vimrc
echo "call plug#end()" >> $HOME/.vimrc

Start vim and run :PlugInstall

Navigate to vim plugin folder and run install script

cd $HOME/.vim/plugged/youcompleteme
python3.5 install.py --clang-completer

Get the config script

curl -Lo $HOME/.ycm_extra_conf.py https://raw.githubusercontent.com/alxhoff/dotfiles/master/ycm/.ycm_extra_conf.py

After running, you should be able to complete using CRTL+Space