Hi Tom, Thanks for the expr. It works like a charm. I do have a couple of questions though 1. How can we expand this so that multiple nesting (based on timestamp) will be supported? i.e. if we have logs for two days 2011-03-20 and 2011-03-21, the first level would have only two lines shown (when folded) viz. 2011-03-20 and 2011-03-21. Then upon opening one of the folds, each would have upto 24 folds (one for each hour), then each hour would have upto 60 folds (one for each minute) and so on.
2. The [Other info] in the example is info I don't really care about. Is there a concept of a vertical fold/any way to hid the [Other info] fields? Thanks a lot for your response. -cb On Mon, Mar 21, 2011 at 5:31 PM, Tim Chase <v...@tim.thechases.com> wrote: > On 03/21/2011 01:43 PM, sanjay ravat wrote: > >> [2011-03-21T18:45:46.004-07:00] [Other info]... log message >> [2011-03-21T18:45:46.008-07:00] [Other info]... log message >> [2011-03-21T18:45:46.607-07:00] [Other info]... log message >> > > Thanks for the example data and better description. After experimenting > with it, I came up with the following: > > :set foldmethod=expr > foldexpr=(getline(v:lnum)[:19]==getline(v:lnum+1)[:19])?1:'<1' > > Change the 19 according to which depth you want: > > Seconds: 19 (above example) > Minutes: 16 > Hours: 13 > Days: 10 > Months: 7 > Years: 4 > > which should do what you want. > > -tim > > > > -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php