Reputation: 84832
vim + ctags
works well for C projects, since C does not allow function overloading and, in general encourages manual prefixing of symbols due to rudimentary scoping facilities.
In C++, functions are frequently overloaded, and overridden in subclasses. This makes vim always jump to the tag in the wrong class on "Ctrl + ]"
. Is there a way to make it behave a little more intelligently? I know I can bring a list with tag alternatives, but that's insanely annoying to always have to bring up this list, and find a needed tag by number whenever I want to jump to definition.
Upvotes: 18
Views: 3242
Reputation: 23065
I use tjump a lot. It supports tab completion which is helpful. If multiple tags are found, it will give a list for you to select from, if only one is found, it will jump right to the tag (unlike tselect).
Usage:
:tj foo
Upvotes: 8
Reputation: 59844
You can use my script which will help you to select tag you need by typing some letters of the class name or special tags like 'field', 'function', 'constructor', etc.
http://www.vim.org/scripts/script.php?script_id=2507
Upvotes: 5
Reputation: 13581
I know two workarounds for your porblem ( it seems you knew it too ):
Upvotes: 7
Reputation: 264471
There is also "tagNext" to move to the next tag (or :tn<enter>)
Upvotes: 13