Sunday, November 27, 2011

Re: copy paragraphs containing

On 11/27/11 13:38, Bee wrote:
> Thank you. That works but if there is more than one occurrence
> of / pattern/ in the paragraph, the paragraph is copied 'N'
> times. Is there a way to get only one copy of the paragraph?

You might want to try something like

:let @a=''|g/^\(\%^\|\n\)\(.\+\n\)*.*Regexp/;'}y A

which searches for paragraph-starts that contain "Regexp" within
the paragraph. It then yanks from that beginning-of-paragraph to
the next paragraph-end, appending to register "a" (which we clear
out at the beginning.

-tim


--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: