From: Mauricio Fernandez Date: 2006-05-12T01:35:03+09:00 Subject: Re: Simplifying Vim folding On Wed, May 10, 2006 at 08:07:38PM +0900, Doug Kearns wrote: > G'day folks, > > I was planning on simplifying the default folding provided when > foldmethod=syntax. > > Currently pretty much everything is folded but I was planning on > reducing this to just module/class/method definitions, multi-line > comments and __END__ data chunks, with an option to disable comment > folding. > > We could, of course, make this 'infinitely' configurable but I see > little point. Is anyone particularly enamoured with having their > multi-line regexes folded? ;-) I've written a plugin that achieves something similar; it's a much improved version of the vimscript I'd had in my .vimrc for a long time. It is available at http://eigenclass.org/hiki.rb?simplefold+plugin+0.4.0 There are also a few animations comparing it to fdm=syntax and fdm=marker. Some features: * folds on module/class/method/{constant,attribute} definitions ("top-level folds") These folds are *not* nested, so methods inside a class are always visible, even when all folds are closed. This way zM gets you a high-level view of all of the file without having to open some module/class folds. * I've added folding on if/while/until/blocks/etc ("nestable folds") (can be turned of, but it's not a problem since we have zO) * top-level folds are enlarged to include preceding comments (good for RDoc'ed code) * the use of a specialized foldtext achieves over 60% savings in vertical space over fdm=marker at the class level. * it is possible to specify additional "top-level" folds with #{{{ / #}}} and additional "nestable" folds with {{{{ / }}}}. -- Mauricio Fernandez - http://eigenclass.org - singular Ruby