Vim - ctags: tag not found
Solution 1
Yes, you should tell Vim where to find your tags
file with something like:
:set tags=/path/to/tags
This is not very optimal, though. This line in your ~/.vimrc
should help:
set tags=./tags,tags;$HOME
It tells Vim to look for a tags
file in the directory of the current file, in the current directory and up and up until your $HOME
(that's the meaning of the semicolon), stopping on the first hit.
Solution 2
The 'tags'
variable must point to your tags
file. See :help 'tags'
.
An example to add the path to your tags file:
:set tags+=$HOME/yourpath/tags
user16948
Updated on August 16, 2020Comments
-
user16948 over 3 years
I want to use Ctags for a Zend framework project. I executed this command :
ctags -R ./* ../ZendFramework/*
to create a list of tags, but the problem is when I pressCtrl-]
on a class or method I get this error:ctags: tag not found
I checked the
tags
file and all classes/methods/variables are listed. Thetags
files is located in the root of the project. Should I load it manullay when I open a file? -
crisron over 8 yearsYou might also find
set autochdir
useful. -
Li Yingjun almost 6 yearsIt is very useful,Good!
-
2.7182818 about 2 yearsIn my case,
set tags=./tags
works with vim7.x but not with vim8.0. In vim8.0set tags=tags
works. -
linjiejun almost 2 years:set tags=/path/to/tags work for me. I met this issue in my ubuntu16,but not in my ubuntu22
-
linjiejun almost 2 years有效果。在我的ubuntu16上碰到过这个问题。但是ubuntu22没有,u22安装完直接使用就可以了
-
linjiejun almost 2 years:set tags=/path/to/tags only absolute path work in this way