Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to color my vimgrep result patterns

Tags:

vim

search

When using Vim is there a way that :grep or :vimgrep will color the patterns returned to the buffer?

like image 828
Luis Avatar asked Mar 31 '09 22:03

Luis


2 Answers

If you search for the pattern after you've :vimgrep'd it, Vim will highlight it. Just edit the :vimgrep pattern files into :g/pattern/.

For a richer solution, try this script.

like image 145
George V. Reilly Avatar answered Sep 22 '22 03:09

George V. Reilly


You can use the Unix grep:

:!grep --color pattern %

There may be other solutions using internal grep/vimgrep but this one works for me.

like image 42
Taurus Olson Avatar answered Sep 19 '22 03:09

Taurus Olson