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

How do you use a macro to convert spaces in words to underscores?

Answer

qaf r_q

Explanation

Record a macro that finds the next space with f and replaces it with an underscore using r_. Run repeatedly to convert variable names.

Next

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