1

I have generated tags using ctags -R .

In Vim I'm able to find the tag when I type :tag TagName and it does jump to it.

However, if I have a cursor over the TagName and do Ctrl+] vim shows cstag: tag not found.

I know indeed the TagName is in the tags file but why I'm not able to jump with the short-cut key? There are some tags I'm able to jump with Ctrl+] not sure why. Also I have set tags=~/Mycode/tags.

4
  • It sounds like you have cscope enabled. Try set nocscopetag
    – Mass
    Feb 4 at 15:40
  • Thanks Mass! yes this does fix the issue :) does this mean i can't have ctags with cscope enabled at the same time?
    – JZ67
    Feb 4 at 15:50
  • @JZ67 well, if you have cscopetag, it overrides the :tag commands. You can have both, but you'd have to use the individual commands (:help :cscope and :help :tag)
    – D. Ben Knoble
    Feb 4 at 16:50
  • Thanks @D.BenKnoble that make sense.
    – JZ67
    Feb 4 at 19:27
1

With cscopetag enabled, you get E257 on tags not being found (credits Mass in the comments).

Fortunately, the help for this error contains useful information: use :cstag! It can do searches in both; precedence is controlled by 'cscopetagorder'.

Of course, the error and description of cscopetag make it sound like the tag wasn't found after searching both, so that's a different issue.

1
  • Mass's suggestion "set nocscopetag" worked for me. Interestingly now after i set my tags dir in vimrc according to:vi.stackexchange.com/questions/29030/… Now jump to the tag works perfectly, i can even comment out "nocscopetag"
    – JZ67
    Feb 5 at 3:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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