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)
You can use the
taglist()function. From:help taglist()(in Vim 7.1):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-completionfor more on this.