Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In GVIM how can we search and highlight while keeping the previous search highlighted

Tags:

vim

In GVIM how can we search and highlight while keeping the previous search highlighted. Example As we search a new pattern the previous pattern gets un-highlighted.

So is ter a way we can retain the previous search highlighted while searching new patterns simultaneously.

regards

like image 778
James bond Avatar asked Jan 31 '12 06:01

James bond


1 Answers

For your second search you can use

:2match Search /pattern/

For a third search term you can use :3match.

If you don't want to type this, you can put a command like this in .vimrc

command -nargs=1 S2 :2match search /<args>/

And in VIm just type :S2 pattern

like image 182
Bernhard Avatar answered Dec 27 '22 13:12

Bernhard