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

How do you record a macro to delete all blank lines in Vim?

Answer

qa/^$/\ndd@aq

Explanation

Record a macro that searches for blank lines, deletes them, and recurses. This processes the entire file automatically.

Next

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