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

How do you record a macro to delete text from cursor to a specific pattern?

Answer

qad/pattern\nq

Explanation

Record a macro that deletes from the cursor to the next match of a pattern using d/pattern. Useful for structured text cleanup.

Next

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