Vim autocompletion/tagging tip

Not quite sure where to put this, but I stumbled on a decent way to generate tags for autocompletion when coding in (n)vim that I would like to share. It requires the vim-gutentags plugin.

In vimrc, put these two lines of code:

let g:gutentags_project_root = ['.gutctags']
let g:gutentags_add_default_project_roots = 0

Then you need to put an empty file .gutctags in the project root, in my case this would be:
~/of/of_v0.11.0_linux64gcc6_release/.gutctags

This should populate an oF-wide tag file, including all addons and all libraries present in the oF tree. Obviously this would also include all tags from other apps you develop, so there is still the namespace pollution problem to deal with, but so far this is the best/quickest way to get a complete tag file including all the of* goodies as well in (n)vim! Hope this is useful for somebody, and I’d be also very happy to hear of better ways to do this!

2 Likes

Great! I’ll give it a try!
You know if vim-gutentags plugin is available as distro package (ubuntu/debian)?

Not sure, I’m on Arch, but for my vim plugins I’m using junegunn/vim-plug, and then topgrade, a very, very awesome systems upgrader that takes care of all my upgrade needs in one little command.