On Thu, 4 May 2006, Jack Donohue wrote:
:v (and :g) made my day..!
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.
Perhaps this would do:
:set foldenable foldexpr=getline(v:lnum)=~@/
To fold consecutive lines that start with the word "fold", first search
/^fold
or
:let @/ = "^fold"
Then do
:set foldmethod=expr foldlevel=0
to fold every search match.
HTH.
--
Gerald