I'm using Vim for a C++ project that I've started working on and I've been spending a lot of time lately browsing through the existing code to get a hang of it. To make the browsing easier, I've setup ctags and cscope in Vim to jump to definitions and find references.
However, I find that neither of them are intelligent enough to know which class a member variable/function belongs to. For example:
class Square;
...
Square a;
...
a.rotate();
Attempting to find the definition of rotate()
will bring up member functions from other classes too, like Triangle. I use g]
in Vim to bring up a list of matching tags and fortunately ctags lists the associated class for each entry. However, when there are 200 classes with the same member function, it can be tiresome to hunt down the correct tag.
Also, if I am at a function definition:
Square::rotate()
{
...
}
Attempting to find all calls to rotate()
using cscope brings up calls to Triangle's and other classes' rotate functions.
Because of this, I find myself jumping to Visual Slickedit every now and then to find the definition or reference to a member function or member variable. Is there any way I can accomplish this in good old Vim?