在 vim 中获取 ctags 以转到定义,而不是声明 [英] Get ctags in vim to go to definition, not declaration

查看:28
本文介绍了在 vim 中获取 ctags 以转到定义,而不是声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到的问题是 vim/gvim 中的 ctags 多次将我带到前向声明而不是函数的实际定义.

I'm having the problem that ctags in vim/gvim takes me to a forward declaration a lot of times instead of to the actual definition of the function.

有什么办法可以解决这个问题吗?

Any way to get around that?

推荐答案

我认为最简单的方法是使用g ctrl-]"而不是ctrl-]".如果只有一场比赛,它会带你去那里.如果有多个匹配项,它将列出所有匹配项,让您选择所需的一项,就像 :tselect 一样.两全其美的.:)

I think that the easiest way is to use "g ctrl-]" instead of just "ctrl-]". If there is only one match, it will take you there. If there are multiple matches, it will list them all, letting you choose the one you want, just like :tselect. The best of both worlds. :)

这篇关于在 vim 中获取 ctags 以转到定义,而不是声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆