I have just discovered the taglist plugin for vim, and read about how to use it with ctags.
However, disappointingly ctags is a very simple parser.
Is there an alternative that is more complete?
Specifically I'm looking for something that:
expands #define(x, y) x ## y
style macros for function declarations
processes #include
statements
allows include paths to be specified for dependencies
I see that clang provides a programatic api for accessing the c AST, so surely this isn't terribly hard to do?
Has someone already done it?
--
Edit:
These ones don't cut it:
clang_indexer - Doesn't compile; when it does (after hacking), doesn't work (endless errors).
clang_complete - Doesn't seem any better than ctags. No context specific recommendations, no struct completion, no function arguments, no macro expansion; just a list of symbols and the file they came from.
cscope, ctags, and Vim are powerful tools for reading a lot of code. ctags can be used to take you to the definition of a variable (e.g., a function, variable, or macro). cscope can be used to take you to the call site of a definition (e.g., all function calls, all variable uses, all macro uses).
Vim's built-in code navigation functionality using ctags is fantastically useful. Properly configured, it can allow you to jump from file to file in a project with one or two keypresses. Position the cursor over an object or function name, press C-] and Vim takes you directly to its definition; C-o takes you back.
I've spent quite some time struggling with this myself.
The closest I ever got was something called gccsense. Unfortunately, the project seems abandoned and moreover it was difficult setting it up because English was not the author's first language.
I ended up approaching the problem from another angle. I made the decision that intellisense/autocomplete was more important to my coding than having all the available features of vim, so I chose an IDE like Eclipse, and then found a plugin for Eclipse that emulates Vim. So far the best kind of plugin like that that I found was Viable.
Here is the full list of options that I have tried and found unsatisfactory:
If you do find a solution you are happy with please share it in a comment, because I would be interested in it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With