Search multiple windows

17 views
Skip to first unread message

Ben Mehmet

unread,
Apr 24, 2023, 3:38:10 PM4/24/23
to vim_use
Hi All,
I have this searching within multiple windows open. 
Basically, lets say I have a VIM session with 2 or more windows open and I end searching for some text in one of the windows. Search will end up taking me the next occurrence of the search pattern and if I have highlighting set it will also highlight it for me. This by itself is very helpful and nice. 
My question, however, is is there a way/plugin/mapping that I could enable to have vim highlight and move to next occurrence of my search pattern in all the rest of windows highlighted as well.

Thanks for any help with this question.
-Ben

rwmit...@gmail.com

unread,
Apr 24, 2023, 3:55:44 PM4/24/23
to vim_use
https://www.vim.org/scripts/script.php?script_id=5875

was just announced (the update, anyway).  Not sure if it auto advances to the next tab though.

Tim Chase

unread,
Apr 24, 2023, 4:02:47 PM4/24/23
to vim...@googlegroups.com
On 2023-04-24 12:38, Ben Mehmet wrote:
> My question, however, is is there a way/plugin/mapping that I
> could enable to have vim highlight and move to next occurrence
> of my search pattern in all the rest of windows highlighted

I usually do this semi-manually with something like

:windo /pattern

to jump to the next match in each window or

:windo g/pattern/#

to list all the matching lines in all of the windows

Because 'hls' is a global option, if you have it enabled, it should
highlight things in the rest of the windows too, not just the current
one.

-tim





Reply all
Reply to author
Forward
0 new messages