I recently started working on a big C project at Nuage. I have worked in C at Netapp for 9 years and was looking forward to this new work as result. Man, I am so glad so be able to program in C again. I was also happy to realize that my C chops are still quite good.
However having worked with Java/Python for past 2 – 3 years and being used to the awesome Intellij IDE, I really wasn’t enjoying working with vim again. My complaints about vim were two fold. First writing code in C is quite verbose, especially for the low level stuff I was working on. (I really missed Java’s awesome collection library and stream API. Those things made writing software such a joy). The second complaint about vim is lack of auto completion, which makes the first problem all the more worse.
I tried overcoming this problem by using the YouCompleteMe plugin for vim but it wasn’t working quite well with my C project. (C projects do not have a standard way to compile and build, each one of them has a different way of building things). Initially the auto-completion with YouCompleteMe really sucked, until I discovered the bear tool. The bear tool lets you generate a compilation database for your project (You just prepend your make command with bear) and once this is done, autocompletion worked as charm in Vim. Morever YouCompleteMe dynamically complies the C file so, I get syntax errors while writing the code itself. What a timesaver and productivity booster.