A colleague of mine is using a horrible source code editor that leaves strange comments all over the code. In Visual Studio, I created a macro, that simply folds all those comment blocks so I don't have to see them.
Now I would like to do the very same thing in vim.
This regex matches every one of those blocks:
/^.*\/\* EasyCODE.*\(\(\n.*\*\/\)\|\(\n.*\/\*.*\)\|\(\n\/\/.*\)\)*/
Now I bet there is a really nice way to fold all matches of this pattern in vim. However, I am rather new to vim and don't know how to do this.
Could you help me there?
Edit: some examples:
These comment blocks always begin with /* EasyCODE
. Sometimes the comment have a closing */
right on the end of the first line, sometimes only on the next line. The following lines might or might not contain additional "/* EasyCODE
..." blocks.
One of these blocks could look like this
/* EasyCODE ) */
/* EasyCODE ( 0
some text */
/* EasyCODE F */
or like this
/* EasyCODE V8 */
/* EasyCODE ( 0 */
or like this
/* EasyCODE > */
As I said, the above regex catches them all.