Sunday, November 27, 2011

copy paragraphs containing

I have a file containing groups of lines separated by an empty line.

In vim speak each group is called a paragraph and I can use the
following from motion.txt to move by paragraph:

*{*
{ [count] paragraphs backward. |exclusive| motion.

*}*
} [count] paragraphs forward. |exclusive| motion.

How would I find all 'paragraphs' that contain a specific string and
copy each paragraph to another buffer or register?

I know how to do it with lines:

qaq
:g /string/y A

--
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:

Post a Comment