How to color my vimgrep result patterns

后端 未结 3 1746
慢半拍i
慢半拍i 2021-02-14 18:39

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

相关标签:
3条回答
  • 2021-02-14 19:17

    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.

    0 讨论(0)
  • 2021-02-14 19:21

    You can use the Unix grep:

    :!grep --color pattern %
    

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

    0 讨论(0)
  • 2021-02-14 19:36

    Maybe ack fits your bill?

    0 讨论(0)
提交回复
热议问题