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

How do you use a macro to reverse the order of words on a line?

Answer

qa$bywdw0Pa <Esc>q

Explanation

Record a macro that yanks the last word, deletes it, pastes it at the beginning of the line. Repeat to reverse all word order.

Next

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