Is there any way to highlight multiple searches in (g)Vim?

Viewed 75939

I want to search for multiple strings in Vim/gVim and have them highlighted in different colours. Is there a way of doing this with out-the-box Vim or with a plug-in?

10 Answers

MultipleSearch : Highlight multiple searches at the same time, each with a different color.

http://www.vim.org/scripts/script.php?script_id=479

:Search <pattern1> //will highlight all occurences of <pattern1> in the current buffer.
A subsequent :Search <pattern2> will highlight all occurences of <pattern2> in the current buffer.
:%s /red\|green\|blue/

I am not sure about how to keep different colors for different keyword though. Thanks.

Related