Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

separate searches in windows in VIM

Tags:

vim

search

split

When I split VIM to show me a few files or a different parts of the same file, is there any way for me to have one search in one window and a different search in another one? For instance, I'd like the upper window to have the search pattern foo and the lower window to have the search pattern bar.

The active search pattern affects what is highlighted when using search highlighting, and it is pretty annoying when I have foo highlighted in the upper window, and then I switch to the lower window and search for bar, and foo stops being highlighted in the upper window.

Edit: This question seems to be related, though I'm not sure it's an exact duplicate.

like image 595
Nathan Fellman Avatar asked Jun 22 '09 07:06

Nathan Fellman


1 Answers

I use this script for highlighting multiple search patterns.

like image 157
Canopus Avatar answered Oct 10 '22 11:10

Canopus