Vim - ctags: tag not found

百般思念 提交于 2019-11-28 16:45:38

问题


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 press Ctrl-] 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. The tags files is located in the root of the project. Should I load it manullay when I open a file?


回答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.




回答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


来源:https://stackoverflow.com/questions/11975316/vim-ctags-tag-not-found

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!