如果您在标签文件中注意到字段是制表符分隔的.但是,当ctags生成cache_objects标记时,它将在其后面包含空格. vim在使用<C-]>时仅查找完整的单词,这就是为什么它没有找到标签但在使用正则表达式搜索时却找到了标签的原因.如果您将行更改为function cache_objects(basedir)有效.I'm starting out Lua development, so I ran ctags on a simple starter project and tried jumping around the source code with + . Upon trying this, I got E426: tag not found: cache_objects where cache_objects was a function in another file. I checked the tags file and the correct entry was there for cached_objects. I also checked my tags path and it was correct.I then tried explicitly executing the tags command: :ta cache_objects. This returned the same error. Now things are about to get weird. I executed: :ta /cache_objects, and it worked! It brought me to the function defined as:function cache_objects (basedir) ...I triple checked the spelling to make sure it was right. How could this be happening? 解决方案 This is a bug in ctags. http://sourceforge.net/p/ctags/bugs/347/If you noticed in your tags file that fields are tab delimited. However when ctags generated the cache_objects tag it included the space after it. vim only looks for complete words when using <C-]> which is why it didn't find the tag but did find it when you used a regex search. If you change the line tofunction cache_objects(basedir)it works. 这篇关于Vim Ctags表现异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-11 18:15