我会这样生成我的代码(旺盛的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一样聪明?
发布评论