I'm doing a lot of digging around in log files these days, which usually involves tracking a certain identifier through various places in the log file. If I search for the identifier, then vim highlights all the occurrences, which really helps in the digging, but it disappears if I search for something else.
Is there a quick way to get vim to highlight, e.g., change the background or color, of text matching a certain regular expression?
I suppose syntax highlighting is sort of what I want, but it would be nice if there was a more dynamic way.
The command Vim has available for that is :match. You can also use the matchadd() function to add an arbitrary number of matches.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With