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

How do you use a macro to align variable assignments?

Answer

qa0f=40i <Esc>040lDjq

Explanation

Record a macro that inserts spaces before = to pad to column 40, then trims excess. Aligns assignments across multiple lines.

Next

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