Get ctags in vim to go to definition, not declaration

Robert S. Barnes picture Robert S. Barnes · Jun 28, 2009 · Viewed 39.1k times · Source

I'm having the problem that ctags in vim/gvim takes me to a forward declaration a lot of times instead of to the actual definition of the function.

Any way to get around that?

Answer

Derek picture Derek · Nov 17, 2009

I think that the easiest way is to use "g ctrl-]" instead of just "ctrl-]". If there is only one match, it will take you there. If there are multiple matches, it will list them all, letting you choose the one you want, just like :tselect. The best of both worlds. :)