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 262571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:31:36+00:00 2026-05-11T22:31:36+00:00

I can get the word under the cursor with or , and I can

  • 0

I can get the word under the cursor with or , and I can use that to open a file and add it to the arg list. For example, with the cursor over a java class name, at line 45:

:arge +45 mydirhere/<cword>.java

But I don’t know how to pass into the the tag mechanism, so it will return the file name (and line number), that can be passed to arge

So I guess my question is specifically: “how do you call the tag mechanism?” I’m expecting something like:

String getFileAndLineforTag(String tag)
  • 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-11T22:31:36+00:00Added an answer on May 11, 2026 at 10:31 pm

    You can use the taglist() function. From :help taglist() (in Vim 7.1):

    taglist({expr})                         *taglist()*
            Returns a list of tags matching the regular expression {expr}.
            Each list item is a dictionary with at least the following
            entries:
                name        Name of the tag.
                filename    Name of the file where the tag is
                        defined.  It is either relative to the
                        current directory or a full path.
                cmd     Ex command used to locate the tag in
                        the file.
                kind        Type of the tag.  The value for this
                        entry depends on the language specific
                        kind values.  Only available when
                        using a tags file generated by
                        Exuberant ctags or hdrtag.
                static      A file specific tag.  Refer to
                        |static-tag| for more information.
            More entries may be present, depending on the content of the
            tags file: access, implementation, inherits and signature.
            Refer to the ctags documentation for information about these
            fields.  For C code the fields "struct", "class" and "enum"
            may appear, they give the name of the entity the tag is
            contained in.
    
            The ex-command 'cmd' can be either an ex search pattern, a
            line number or a line number followed by a byte number.
    
            If there are no matching tags, then an empty list is returned.
    
            To get an exact tag match, the anchors '^' and '$' should be
            used in {expr}.  Refer to |tag-regexp| for more information
            about the tag search regular expression pattern.
    
            Refer to |'tags'| for information about how the tags file is
            located by Vim. Refer to |tags-file-format| for the format of
            the tags file generated by the different ctags tools.
    

    When you define a custom command you can specify -complete=tag or
    -complete=tag_listfiles. If you need to do something more elaborate you can use -complete=custom,{func} or -complete=customlist,{func}. See :help :command-completion for more on this.

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

Sidebar

Related Questions

No related questions found

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.