Marc Costa
65 posts
YouCompleteMe - Vim Completion Engine
I found the information in this page: vimcasts.org very useful for some advanced usage scenarions. I haven't read the book, so I can't comment on that.
3 posts
YouCompleteMe - Vim Completion Engine
It's pretty laggy though if you try to backspace a letter
Chen
102 posts / 2 projects
Some guy trying to make some video game.
YouCompleteMe - Vim Completion Engine
YCM is a pretty sweet engine, but how am I going to configure it if I'm doing unity build (the way handmade hero builds)? It seems to me that it treats every .cpp file as a separate compilation unit so it just breaks when I try to do unity build.
Mārtiņš Možeiko
2265 posts / 2 projects
YouCompleteMe - Vim Completion Engine
Don't name them with .cpp extension? Maybe "file.impl.h" or just "file.inl" so it will treat them as headers.
Timothy Wright
76 posts / 1 project
YouCompleteMe - Vim Completion Engine
Chen96
YCM is a pretty sweet engine, but how am I going to configure it if I'm doing unity build (the way handmade hero builds)? It seems to me that it treats every .cpp file as a separate compilation unit so it just breaks when I try to do unity build.

I have the same problem developing stb headers. When you are in the header, the #define IMPLEMENTATION isn't defined, so it doesn't parse this code.

It's a little janky, but I just make a define like this:

 1 2 3 #if defined(STB_IMPLEMENTATION) || defined(YCM_DEV) // code here #endif 

'-DYCM_DEV',
to the .ycm_extra_conf.py

You can also do this same thing and just add whatever includes you need
so ycm will find them but the unity build won't.

 1 2 3 4 5 #ifdef YCM_DEV #include #include "thing.cpp" // whatever else you need #endif 

It is kinda Janky but I haven't found a better way.
Chen
102 posts / 2 projects
Some guy trying to make some video game.
YouCompleteMe - Vim Completion Engine
Oh yeah, didn't think about that! That's a pretty hacked way but it should work just fine. However if I include multiple ini files (treated as headers now) in a cpp file, wouldn't ycm ignore the fact that preceding files will be invisible to the later included ini files?

One question post on stackoverflow that's similar: