4

I just installed YCM on CentOS 7. I am now at the step of generating a ".ycm_extra_conf.py" equivalent of the file for my project, which is a nested directory of c++ files, uses Scons build system and g++ (with -std=c++98) to compile the c++ files. I have few questions:

  1. Are the contents of the "flags" variable in ".ycm_extra_conf.py" file the flags that are passed to the project compiler, in my case the g++ compiler by the scons build system?
  2. If answer to question 1 is yes, are these same flags then passed to clang when YCM compiles the files? If so, is YCM compiling or more technically processing the c++ files in the project to use for semantic completion?
  3. If answer to question 2 is yes, then I am guessing the flags I state in the "flags" variable will not work for clang, as they are applicable to g++. Should I do a conversion/mapping of the flags to clang?
  4. Does YCM use clang to only front-end compile the files to produce the AST to use for semantic completion?

Sorry about the naive questions, I am very new to YCM. Any help/guidance would be very appreciated.

Regards and thank you, Ahmed.

Ahmed A
  • 3,362
  • 7
  • 39
  • 57

1 Answers1

1

The easiest way to get autocompletion working in vim with ycm is bear:

https://github.com/rizsotto/Bear

Install it and then just run:

bear scons

and you'll get your compilation database that makes ycm happy.

Borealis
  • 51
  • 4