Hiding a regex with vim (aka making C comments disappear)
I use the mighty vim editor for most of my coding. I have a heavily customized setup which has evolved over quite a few years. However, it is by no means a static setup as I keep finding new scripts and tricks (and of course Bram keeps on adding extra goodness with each release). Recently, I was hacking through a lot of C code containing lots of debug cruft (log function calls, commented out bits and pieces, etc). The problem was I couldn't get a feel for the code as all the debug was too distracting. The question popped into my head, "can I hide all this stuff?" A number of folk have come up with ways to "hide" the data you don't want to see in Vim using folds (" :help fold " in Vim). However, that wasn't what I wanted as folds also introduce their own "visual noise". I just wanted this stuff gone . What I came up with is a complete hack, but it suited my purpose rather well: I changed the colour of the regex's matching the ...