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

How do you record a macro to remove comment lines starting with #?

Answer

qa/^#\nddq

Explanation

Record a macro that finds lines starting with # and deletes them. Run recursively with 100@a to remove all comment lines.

Next

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