What are the essential addons to help with editing C?
Allows searching code for:
- all references to a symbol
- global definitions
- functions called by a function
- functions calling a function
- text string
- regular expression pattern
- a file
- files including a file
- generate tag imformation of sources, for navigating them.
- Code outline.
- Function parameter completion, code snippets, and much more.
Definitely use a tags file to navigate around the source. The best tool to create one is Exuberant Ctags, at http://ctags.sourceforge.net/. In Vim you can enter ":help tags" to get more information.
I have a suite for C and C++ programming. It is mainly oriented toward C++ programming, however a few, and unique features can be used in C as well:
- context sensitive snippets (they require other plugins I'm maintaining);
- a way to jump to a function definition from its declaration (or create it on the fly if it doesn't exists yet) (it requires the plugin alternate, which is a must have);
- a little tool that lists functions with a declaration and no definition, or functions with a definition and no declaration (NB: I haven't used it against C static function yet) (it requires ctags).
It is a little bit messy to install right now. I still have a few thing to do before an official and correctly packaged release.
Otherwise, I also use:
- plugins like project/local_vimrc in order to have project specific settings ;
- searchInRuntime to open/jump to files without the need to browse the directories of the current project ;
- an unreleased refactoring plugin (that needs refactorisation ...) ;
- a wrapper around :make in order to do background compiling, and to filter &makeprg results (e.g. pathnames conversions between cygwin posix form and dos form ; application of STLfilt ; etc.) (-> BuildToolWrapper which is stable, but still in an alpha stage) ;
- and a few other things which have already been mentioned (alternate, ctags, ...).
HTH,
All off the above and,
I found this little plugin called code_complete really cute, to "tab complete" like you do in the shell but with you code... Watch this demo and you you will get the idea.
And since we use doxygen to document our code I rather easily expanded that script to create a /** @bla bla etc etc */ type off thing that was compatible with out coding standards. (Thinking about it, it is quite close to the javadoc type of comments)
/Johan
For code completion I would recommend snippetsEmu. It is very easy to customize.