init-random
init-random

Reputation: 21

Vim Taglist Navigation

I am trying to configure taglist with vim. I ran :TlistAddFilesRecursive at the root of my java source. Say I have a class

class Foo extends Bar {
}

I place my cursor is on Bar and I do

Ctrl-]
I get

E433: No tags file
E426: tag not found: Bar
Press ENTER or type command to continue

However, if I :TlistToggle and search for Bar then press enter, the class is findable and it opens.

Does anyone know what would cause this?

Thanks.

Upvotes: 2

Views: 5977

Answers (2)

Bazman
Bazman

Reputation: 1229

taglist plugin is separate to the tags browsing in VIM.

For the tags browsing in VIM to work, you need to set the path to your tags file by settings the tags option. e.g.: set tags=./tags,tags

See :help tags-option

The taglist plugin runs ctags as requested and doesn't store the results in files. It just executes, parses and displays the output directly.

Upvotes: 1

unixnoob
unixnoob

Reputation: 21

Use the easytags plugin: http://www.vim.org/scripts/script.php?script_id=3114


From what I understand using Ctrl-] and Ctrl-t to navigate tags is part of vim itself (NOT Taglist). It gets the information from a tag file that you need to generate using ctags (example ctags -R ). If you generate such a tag file you will see that Ctrl-] works just fine.

Now, what TagList does is show the tags for the currently active file in a sidebar (it uses ctags for this but I don't know where it stores the tags file). If you manually add using TlistAddFilesRecursive it updates its internal tags file with tags from these files. I think the way TagList is supposed to be used is by browsing through the tags in the taglist window and pressing "enter" to jump to the definition.

Upvotes: 2

Related Questions