Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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? For example, when search "foo" in the buffer, the feature put markers along with the vertical scrollbar. Each marker indicates an matched "foo". When you scroll to that position, you see a "foo" in the buffer. 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?

In Firefox the similar feature is done by Search Marker (outdated), XUL/Migemo (outdated) or FindBar Tweak (up-to-date) extensions.

UPDATE:


(source: mozilla.net)


(source: mozilla.net)

like image 513
Crend King Avatar asked Feb 16 '11 22:02

Crend King


2 Answers

Try :set hlsearch to get highlighted search terms.

Also try pressing ^G to see the line and column of the cursor.

like image 21
maerics Avatar answered Nov 15 '22 04:11

maerics


If you want to see the distribution, you could try:

:g//#

this will show the lines where the search pattern is found.

like image 185
Benoit Avatar answered Nov 15 '22 05:11

Benoit