1

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!

BigBrownBear00
  • 1,378
  • 2
  • 14
  • 24

1 Answers1

3

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.

xtofl
  • 40,723
  • 12
  • 105
  • 192
  • Actually, clang is well distributed by now, however the Python bindings are not (generally) and I believe them to be necessary for the auto-completion. – Matthieu M. Sep 09 '12 at 13:57
  • @MatthieuM. clang autocomplete can be used in one of two ways, just with the clang compiler (no need for python support in vim) or through libclang (requires python support in vim, and a python interpreter in the system). The latter is supposed to be better (offers more information to the plugin) but I cannot really say – David Rodríguez - dribeas Sep 09 '12 at 14:00