> I thought of this when I had a large file and wanted to see
> only the lines that contained the search text, so I could
> compare them in context.  Is there a way to automatically use
> multiple folds for all the other text NOT containing the
> desired search text?

While it takes manual refreshing...

1) search for what you want

2) :set foldmethod=expr foldexpr=(getline(v:lnum)=~@/)?0:1 
foldlevel=0


Step #2 can be wrapped in a mapping to make it simple:

   :nnoremap <f4> :set foldmethod=expr 
foldexpr=(getline(v:lnum)=~@/)?0:1 foldlevel=0<cr>

Hope this helps,

-tim




--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to