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