Tim,
Tim Chase wrote: >> 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, Absolutely amazing! I think of doing something that would make it much easier to do a particular task in Vim but have no idea how to do it, post a note to the list and with minutes someone comes up with a solution! I'm flabbergasted! Brilliant! Many thanks, Phil. -- Philip Rhoades GPO Box 3411 Sydney NSW 2001 Australia E-mail: [email protected] --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
