Vim - ctags:未找到标签 [英] Vim - ctags: tag not found
问题描述
我想将 Ctags 用于 Zend 框架项目.我执行了这个命令: ctags -R ./* ../ZendFramework/*
来创建一个标签列表,但问题是当我按下 Ctrl-]
类或方法我收到此错误:ctags: tag not found
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
我检查了 tags
文件并列出了所有类/方法/变量.tags
文件位于项目的根目录中.当我打开一个文件时,我应该加载它吗?
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?
推荐答案
是的,你应该告诉 Vim 在哪里可以找到你的 tags
文件,例如:
Yes, you should tell Vim where to find your tags
file with something like:
:set tags=/path/to/tags
不过,这不是很理想.~/.vimrc
中的这一行应该会有所帮助:
This is not very optimal, though. This line in your ~/.vimrc
should help:
set tags=./tags,tags;$HOME
它告诉 Vim 在当前文件的目录中查找 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.
这篇关于Vim - ctags:未找到标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!