Can't figure out difference - omnicppcomplete versus clang

490 Views Asked by At

I am embarking on setting up my VIM with better autocompletion, mainly for classes. In my google research I came across omnicppcomplete and clang. I can't seem to figure out the advantage/disadvantage of the two. Does anyone know?

Also, is one easier to install on third party systems than the other?

Any feedback will help. Thanks!

1

There are 1 best solutions below

2
On

Clang really 'understands' c++. That means it can tell the difference between a local variable named foo and a member function named foo. If you want to complete thisObject.fo..., it will not give you the fooContainer completion, but only the Object::fooMethod.

Also, Clang can handle all C-type languages, which ctags cannot.

Omnicppcomlete is based on ctags, which is merely a textual index of your source tree. So it will be denser, will most of the time do what you want; sometimes it will be less accurate. Which isn't a real problem.

I have not yet installed the Clang completion though :( You probably have to build clang yourself, while ctags most likely comes with your distribution.