vimtricks.wiki Concise Vim tricks, one at a time.

How do you record a macro to copy lines matching a pattern to end of file?

Answer

qa/pattern\nyy}pq

Explanation

Record a macro that searches for a pattern, yanks the matching line, goes to the end of the paragraph, and pastes it. Collects matching lines.

Next

How do you yank a single word into a named register?