"E426: tag not found error" when generating tags
Asked Answered
D

2

8

I've got a macvim snapshot 64 downloaded from here and exuberant ctags installed via homebrew:

which ctags
/usr/local/bin/ctags

my tags variable in vim looks like this:

:echo &tags
/Users/macovsky/code/faces/tmp/tags,./tags,tags,/Users/macovsky/.rbenv/versions/1.9.2-p290/lib/ruby/site_ruby/1.9.1/tags,/Users/macovsky/.rbenv/versions/1.9.2-p290/lib/ruby/site_ruby/1.9.1/x86_64-darwin11.2.0/tags,/Users/macovsky/.rbenv/versions/1.9.2-p290/lib/ruby/site_ruby/tags,/Users/macovsky/.rbenv/versions/1.9.2-p290/lib/ruby/vendor_ruby/1.9.1/tags,/Users/macovsky/.rbenv/versions/1.9.2-p290/lib/ruby/vendor_ruby/1.9.1/x86_64-darwin11.2.0/tags,/Users/macovsky/.rbenv/versions/1.9.2-p290/lib/ruby/vendor_ruby/tags,/Users/macovsky/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/tags,/Users/macovsky/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/x86_64-darwin11.2.0/tags,/Users/macovsky/code/faces/tags 

and I generated the tags file with rails-vim's :Rtags command:

file tmp/tags 
tmp/tags: Exuberant Ctags tag file text

the problem is that whether I use C-] or :tag it all fails with a E426 tag not found error.

The tag is definitely there:

cat tmp/tags | grep post_image
post_image  /Users/macovsky/code/faces/app/helpers/posts_helper.rb  /^  def post_image(post, style)$/;" f   class:PostsHelper

Any suggestions? Thank you.

Doddering answered 11/3, 2012 at 12:15 Comment(3)
This happens to me to, did you ever get a solution?Verboten
@macovsky I am guessing its the way you set up the tags file. Did you try using ctags -R ? This recursively searches for all the directories for files and gets tags from themStraightjacket
He said the tag is definitely there. Is it possible that the tags are being generated with a relative path to a directory that is throwing vim off?Siloam
A
2

Make sure you added a semicolon to your tag paths in .vimrc:

set tags=./tags;,./gems.tags;

There is an explanation.

Automatize answered 1/6, 2017 at 1:9 Comment(0)
K
0

The problem might be that you define the tags to be in tmp/tags, however your tags variable only holds a link to a tags file in the current directory.

Try either putting your tags file in the current directory or add ./tmp/tags to your vim tags variable. (I would prefer the first option)

\Paul

Kolva answered 14/8, 2013 at 15:40 Comment(1)
If the tag file is not found vim gives an additional error code: E433: No tags file.Roundlet

© 2022 - 2024 — McMap. All rights reserved.