如何使vim标签跳转像OmniCppComplete一样聪明?

编程入门 行业动态 更新时间:2024-10-28 09:27:33
本文介绍了如何使vim标签跳转像OmniCppComplete一样聪明?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我会这样生成我的代码(旺盛的Ctags 5.9〜svn20110310):

I generate my tags (Exuberant Ctags 5.9~svn20110310) like this:

ctags --c++-kinds=+p --fields=+iaS --extra=+q -L ctags.files

我大致具有以下类结构:

I have roughly this class structure:

class RenderObject { InterpolatedVector offset; }; class Quad : public RenderObject { }; class KeyframeWidget : public Quad { void shiftRight() { if (!offset.isInterpolating()) offset.interpolateTo(Vector(offset.x+80, 0), 0.1, 0, 0, 0); } };

(代码来自 Aquaria的开源版本.)

如果我标记跳转到offset( Ctrl -] ),那么我在代码库中的每个offset都会得到一个列表.在我键入offset.到shiftRight()的末尾之后,OmniCppComplete开始仅提供InterpolatedVector的补全.

If I tag jump on offset (Ctrl-]), then I get a list every offset in my codebase. After I type offset. to the end of shiftRight(), OmniCppComplete starts offering completions only for InterpolatedVector.

如何使我的标签跳跃得像 OmniCppComplete 一样聪明?

How can I make my tag jumps as smart as OmniCppComplete?

仅仅是标签跳转不使用任何上下文,因此它们仅知道符号名称吗? (与:tag <C-r><C-w><CR>完全相同吗?)是否有vim替代方法可以使它们具有上下文意识?

Is it just that tag jumps don't use any context, so they only know symbol names? (Is it the exact same as :tag <C-r><C-w><CR>?) Is there a vim alternative that makes them context-aware?

推荐答案

我最近开始将SmartTag插件用于Vim&发现它非常善于使用周围C ++代码中的上下文信息来找到正确的标记.

I recently started using the SmartTag plugin for Vim & find it very good at using contextual information from the surrounding C++ code to find the right tag.

您可以在这里下载:

github/MarcWeber/SmartTag

要在Ctrl-]中使用它,您将需要在tagfunc中使用Vim版本 已应用补丁.在这里:

To be able to use it with Ctrl-] you will need to use a Vim release with the tagfunc patch applied. It's here:

llorens.visualserver/vim73-tagfunc.zip

更多推荐

如何使vim标签跳转像OmniCppComplete一样聪明?

本文发布于:2023-07-23 07:37:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1195204.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:跳转   聪明   标签   vim   OmniCppComplete

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!