Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6604983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:13:45+00:00 2026-05-25T19:13:45+00:00

Given the following code: // MyClass.h class A { void foo(); } class B

  • 0

Given the following code:

// MyClass.h
class A {
    void foo();
}

class B {
    void foo();
}

// MyClass.cpp
void main() {
    A a();
    a.foo();
}

Given that I am using vim and have my ctags generated, if I place my cursor over the foo() in main() and hit ctrl+], I will get a list of the implementations of foo, as there are more than one. If there was only one, then it would jump immediately to that implementation.

Is there a way in vim for the type of a to be inferenced such that when I hit ctrl+], it immediately jumps to the implementation of A::foo() rather than supplying me with a list of choices? It seems like such a plugin should exist and I am just unable to find it.

Update: It appears that there is currently no solution to this problem, so I have selected exclipy’s answer below. Should a solution present itself and a new answer be made available, I will update the answer to this question.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:13:46+00:00Added an answer on May 25, 2026 at 7:13 pm

    What you want to do isn’t possible unless Vim can actually parse the entire C++ translation unit, as a C++ compiler would. This is far beyond the scope of ctags, which uses very simple heuristics to merely tokenize the vicinity of the cursor.

    So the obvious solution to this is… plug a C++ parser into Vim! There is actually a plugin called clang_complete, which already does most of the heavy lifting of hooking into the Clang C++ parser. From this base, it should be a simple matter to extend it to use the Clang API to implement jump-to-definition.

    In fact, I have started working on such a feature, through two projects: clang_indexer, which crawls the source tree to build an index on disk, and my fork of clang_complete, which adds the feature of querying the index for usages of the symbol under the cursor. This is actually a bit more than what you’re after because I’m aiming for a “find all references” feature (with the option of filtering the results to just definitions).

    It’s at a very early stage and I’m only doing it for myself, so don’t expect it to be very polished solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have my code organized as following class MyClass { public: typedef void (MyClass::Ptr2func)();
I have the following code: class MyClass: def __private(self): print Hey man! This is
Given the following code: class foo { }; class bar: public foo { public:
Given the following code: [example.h] class MyClass { public: MyClass(); std::string name; std::string address;
Given the following code (that doesn't work): while True: # Snip: print out current
The following code works: @Stateless @LocalBean public class MyClass { @PersistenceContext(name = MyPU) EntityManager
Given the following code: a = 0 def foo(): # global a a +=
given the following code: public class MainFrame extends JFrame{ public MainFrame() throws HeadlessException {
Given the following code: class A extends Actor { def act() { loop {
Given following html code: <ul> <li> <a href=somelink> <span class='someIconCss'></span> <span>home</span> </a> </li> [possibly

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.