On Wed, Mar 23, 2011 at 8:32 AM, Tim Chase <v...@tim.thechases.com> wrote:

> On 03/23/2011 10:05 AM, Benjamin R. Haskell wrote:
>
>> On Wed, 23 Mar 2011, Tim Chase wrote:
>>
>>> set
>>>
>>> foldexpr=(getline(v:lnum)[:19]==getline(v:lnum+1)[:19])?6:((getline(v:lnum)[:16]==getline(v:lnum+1)[:16])?'<6':((getline(v:lnum)[:13]==getline(v:lnum+1)[:13])?'<5':((getline(v:lnum)[:10]==getline(v:lnum+1)[:10])?'<4':((getline(v:lnum)[:7]==getline(v:lnum+1)[:7])?'<3':((getline(v:lnum)[:4]==getline(v:lnum+1)[:4])?'<2':'<1')))))
>>>
>>> looks like it works for me.
>>>
>>
>> Get thee to a function!
>>
>
> Indeed -- my reply was an ugly one-off that is far better suited for a real
> function that's data-driven (your "s:levels") like Benjamin's.
>
> So, "c b", use Benjamin's solution instead of mine :)
>
> -tim
>
>
>
Thanks all for the help!

I noticed that now when I open source code in vim, it doesn't fold
(obviously since the foldexpr is set as decribed above). Is there a way to
write the .vimrc so that it will use TimeStampFold() when folding files with
a .log extension and use default (I believe it was indent) folds for source
code?

Thanks again for all the help!

-cb

-- 
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

Reply via email to