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

How do you record a macro to enclose each word in parentheses?

Answer

qaciwi(<C-r>")<Esc>wq

Explanation

Record a macro that changes the inner word, types an opening paren, pastes the original word, types a closing paren, and moves to the next word.

Next

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