Eric Leenman wrote:
> They start with the text WARNING somewhere in the line.
> The end with WARNING ENDED also somewhere in the line
> 
> I tried the suggestions earlier this week, but fail to get this working.

I wager you tried thus:

        :set foldmethod=marker
        :set foldmarker=WARNING,WARNING\ ENDED

This fails because WARNING is a substring of WARNING ENDED, so Vim
starts a new fold on WARNING ENDED, instead of closing the current one.

The easiest course of action I can see (being it a log file) is to
change WARNING ENDED into something else.  If the logfiles are named
"myapp-*.log", you can put into your .vimrc:

        autocmd BufRead myapp-*.log  set foldmethod=marker
        autocmd BufRead myapp-*.log  set foldmarker=WARNING,END_WARNING
        autocmd BufRead myapp-*.log  silent %s/WARNING ENDED/END_WARNING/


Tobia

Reply via email to