I would like to search for the pattern "para\_.\{-}variable".
When I am on the highlighted selections (3 pairs of lines in
this case), I would like to yank the highlighted portion to a
register (for evaluation etc).


Well, it's not quite what you describe, but it's like the "n/N" functionality for finding the *next* (or previous) match and highlighting it:

        :nnoremap <f4> //<cr>v//e<cr>
        :nnoremap <f5> ??e<cr>v??<cr>

It might also be handy to have some visual-mode mappings such as

        :vmap <f4> <esc><f4>
        :vmap <f5> <esc><f5>

So you can continue forward/backward in your searching.

Getting it to highlight the results immediatedly after searching is a considerably more difficult stunt. Doable, but not without a number of crazy stunts and mindbendingly opaque mappings. At least from my determination of matters. YMMV ;)

HTH,

-tim




Reply via email to