解决方案
它应该显示如下列表:
1: 345 my_func (int var)
2: 4523 my_func (int var)
3: 10032 my_func (3);
第二列是行号。键入:345跳转到345行。
其他提示
请:在vim上选择以查看完整定义
如果您已经看到了想要的标签 使用,您可以输入'q'并输入 号。
如果您点击跳转按钮,并获得可能的目标列表,请选择该号码,然后再次点击跳转。
所以给出
1: 345 my_func (int var)
2: 4523 my_func (int var)
3: 10032 my_func (3);
如果你点击'2] |',它应该直接跳到那一行。
我遇到了同样的问题,并将先前的答案拼凑在一起并进行了实验,我提出了这个解决方案:
[I // gives list of matches for word under cursor, potentially some matches are in headers. remember the number of the match you're interested in, eg. the 3rd
q // quits the list of matches
3[Ctrl-i // (with cursor in same position) jumps to third match
当我使用vim时,我跳转到标签,例如:
:tag getfirst
我看到的内容如下:
# pri kind tag file
1 F m getfirst /home/sthorne/work/.../FormData.py
class:FakeFieldStorage
def getfirst(self, k, default):
....
8 F m getfirst /home/sthorne/work/.../CGIForm.py
class:CGIForm
def getfirst(self, name):
Choice number (<Enter> cancels):
我输入'5'转到第5次。
如果你不能让你的vim有这种行为(我的vim默认情况下它似乎开启),你可以使用 g] 而不是 ctrl - ] ,与:tselect 类似,而不是:tag
[I
仅列出搜索结果。要跳转到结果,请使用序列 [CTRL + I
。
您可以在以下位置查看相关跳转的完整列表:
尝试使用 123G
转到第123行(参见:h G
)。
不隶属于 StackOverflow