1

I have a C++ template class С and its member function foo(). I also have tags file generated with Exuberant Ctags.

I want to access this function via the :tag command, something like this:

:tag C::foo

However it doesn't seem to work for me. Inspecting tags file for understanding what should I have passed as :tag argument didn't help me.

Is it possible? How should I specify template class?

P.S. :tag foo works fine. The problem is that there a too many of them in different classes so it's hard to find appropriate tag in the taglist. It turned out the simplest way is to use :tag C and then finding /foo which is still a bit awkward.

2 Answers 2

3

There are (universal?) tags options that can request functions names to be prefixed by full scope (namespace + class). Unfortunately, I can't remember which one it is among:

--c++-kinds=+f --fields=+imaSftn --extra=+q

Any way, I highly recommend universal ctags instead of exuberant ctags for C++. And BTW, in lh-tags (that I'm maintaining), you'll find a more ergonomic way to select which overload you wish to jump to.

1

For what it's worth, you can use ts:

:ts foo
 # pri kind tag               file
 1 F C f    foo               b.cpp
               class:B
               void foo(){
 2 F C f    foo               c.cpp
               class:C
               void foo(){
Type number and <Enter> (empty cancels):

You can see all matching elements, and select them. But I did not see any option to specify directly the parent element.

1
  • 1
    Please see my PS -- I have about a hundred of foo's and it's a pain to look through all the pages of ts to find my match
    – DimG
    Apr 15, 2016 at 17:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.