简体   繁体   English

gVim - 显示匹配搜索词的位置标记

[英]gVim - show position marker of matched search terms

Is there functionality, plugin or ways in gVim to show markers of matched search terms, which point out their rough positions in the buffer? gVim 中是否有功能、插件或方法来显示匹配搜索词的标记,指出它们在缓冲区中的粗略位置? For example, when search "foo" in the buffer, the feature put markers along with the vertical scrollbar.例如,在缓冲区中搜索“foo”时,该功能将标记与垂直滚动条一起放置。 Each marker indicates an matched "foo".每个标记表示一个匹配的“foo”。 When you scroll to that position, you see a "foo" in the buffer.当您滚动到该位置时,您会在缓冲区中看到一个“foo”。 With this feature I can easily tell the distribution pattern of the term visually, where the current term is relatively in the document and approximately how many occurrences.有了这个功能,我可以很容易地直观地告诉术语的分布模式,当前术语在文档中的相对位置以及大约出现的次数。

If no such feature, is there way to manipulate scrollbar and other GUI components of gVim in plugin?如果没有这样的功能,有没有办法在插件中操作 gVim 的滚动条和其他 GUI 组件?

In Firefox the similar feature is done by Search Marker (outdated), XUL/Migemo (outdated) or FindBar Tweak (up-to-date) extensions.在 Firefox 中,类似的功能由Search Marker (过时)、 XUL/Migemo (过时)或FindBar Tweak (最新)扩展完成。

UPDATE:更新:


(source: mozilla.net ) (来源: mozilla.net


(source: mozilla.net ) (来源: mozilla.net

If you want to see the distribution, you could try:如果您想查看分布,可以尝试:

:g//#

this will show the lines where the search pattern is found.这将显示找到搜索模式的行。

Try :set hlsearch to get highlighted search terms.尝试:set hlsearch以获取突出显示的搜索词。

Also try pressing ^G to see the line and column of the cursor.也可以尝试按^G来查看光标所在的行和列。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM