2

I have set :set tags=./tags;$HOME to do an "upward search" for a tags file. How do I find out what file has actually been loaded?

2 Answers 2

4

Reading :help 'tags' and scrolling a little bit down finds the following sentence:

The tagfiles() function can be used to get a list of the file names
actually used.

Accordingly, :echo tagfiles() will show the name(s) of found tagfile(s).

An easy way to test this is in any of Vim's help files. It will pick up the helptags in <whatever>/doc/tags.

4
  • Ok, thanks. To be fair, this is mentioned nowhere in the reference page for tags.
    – clarkep
    Commented Jul 22 at 7:13
  • I admit it took me amazingly long to find it.
    – Friedrich
    Commented Jul 22 at 7:17
  • 1
    It is mentioned under the relevant doc: :help 'tags'.
    – romainl
    Commented Jul 22 at 15:35
  • ... and that's where I found it... after looking everywhere else :-D
    – Friedrich
    Commented Jul 22 at 16:26
0

echo findfile("tags", "./;$HOME") appears to work, but it is slightly different syntax and redoes the search.

Your Answer

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

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