[英]How to jump to an occurrence from Vim search list
它应该为您提供如下列表:
1: 345 my_func (int var)
2: 4523 my_func (int var)
3: 10032 my_func (3);
第二列是行号。 键入:345跳转到345行。
我遇到了同样的问题,并将先前的答案拼凑在一起并进行了实验,我提出了这个解决方案:
[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上选择以查看完整定义
如果您已经看到要使用的标记,则可以键入“q”并输入数字。
如果您点击跳转按钮,并获得可能的目标列表,请选择该数字,然后再次点击跳转。
所以给定
1: 345 my_func (int var)
2: 4523 my_func (int var)
3: 10032 my_func (3);
如果你点击'2] |',它应该直接跳到那一行。
当我使用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
)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.