68590Re: hiding lines
- May 4, 2006On 2006-05-04, Jack Donohue <jmdonohue@...> wrote:
> > :v (and :g) made my day..!The basic technique of using folding for this is this:
> Yes, I use this a lot if I just want to filter out a set of lines, or see
> only lines containing some text (like the old XEDIT command). But what I'd
> really like to to is continue editing in this view and not lose all the
> hidden lines, more like folding. I expect folding can do this, but I've
> never gotten it to work and it seems pretty cumbersome. I'm looking for a
> simple solution involving maybe a couple of command I can make a map for.
> I guess I'm looking for a g or v command that folds the lines instead of
> actually deleting them.
set foldexpr=getline(v:lnum)=~'text to be folded'
To close all the folds, you can
but I usually use zM to close all folds and zR to open all folds.
You could wrap that in a mapping and maybe a function to make it
easier to use. I usually type it out once, then use the command
line history and editing features to modify the pattern as needed.
Gary Johnson | Agilent Technologies
garyjohn@... | Wireless Division
| Spokane, Washington, USA
- << Previous post in topic Next post in topic >>