On 2/21/07, Jeenu V <[EMAIL PROTECTED]> wrote:
If you pattern happens to be word, then you can place cursor over the
word and then press [I or [i. See also ":h [I"
On 2/21/07, Muddassirali Mirzani <[EMAIL PROTECTED]> wrote:
> Is there a way to display only the lines that match
> a search pattern and hide/fold others.
> Any help appreciated.
> Thanks ..
Hello,
This is what I use:
fu! ToggleFoldByCurrentSearchPattern()
if !&foldenable
set foldenable
set foldmethod=expr
set foldexpr=getline(v:lnum)!~@/
:normal zM
set foldmethod=manual
echo "zR to open all folds; zo top open 1 fold; zc to close 1 fold"
else
set nofoldenable
endif
endfu
:nmap <F5> :call ToggleFoldByCurrentSearchPattern()<cr>
Yakov