Brian Lewis wrote:
I'm editing a file and open a preview window. When I search with /, I'd
like the main window to show highlighted matches, but for the preview
window not to.

nohlsearch seems to be global, so I can't :setl nohlsearch in the
preview window to get what I want.

Maybe there's a way to modify color scheme settings in the preview window
to make highlighted matches look as if they aren't highlighted?

Thanks for the help.


/ or ? search is always global (I mean, it searches within the current file only, but matches are highlighted in all windows); no luck there. Similarly, colorschemes, highlight groups, and the 'hlsearch' option are also global.

If you want to un-highlight the search matches once you're done looking at them, you can use the ":noh[lsearch]" command (without ":set"); if you want to highlight the matches of different patterns to be highlighted in different colors, you can use the ":match" and ":2match" commands. These are all I can think of.

see
        :help :nohlsearch
        :help :match
        :help :2match


Best regards,
Tony.

Reply via email to