SFD
SFD

Reputation: 605

Vim, Help getting YCM working for c++

I am trying to install YouCompleteMe Plugin for VIM. This what I did so far:

  1. I am using Vundle so I added the Plugin to my .vimc
  2. I executed install.py --clang-completer
  3. I added "let g:ycm_global_ycm_extra_conf = '.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py" to my vimrc

I tried testing it on very simple helloworld program however I am not getting any useful suggestions. For instance, when I type 'std::' I dont get any intelisense.

I confirmed that YCM server is running and there are no errors in the logs.

Interestingly when I execute 'ValueError: Still no compile flags, no completions yet.'

Upvotes: 0

Views: 2889

Answers (1)

Vincenzo Di Massa
Vincenzo Di Massa

Reputation: 41

You have to provide a compilation database (easier) or provide compile flags manually.

If you are not using CMake chanches are that you will like Bear.

With bear just clean your project, cd to the build directory and use it to generate the compile_commands.json file. E.g.

$ cd /path/to/your/project/build/directory
$ bear make
$ cp compile_commands.json /path/to/your/project/source/directory

Upvotes: 1

Related Questions