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

How do you use a macro to wrap CSV fields in quotes?

Answer

qaf,i"<Esc>la"<Esc>q

Explanation

Record a macro that finds the next comma, inserts a quote before it, moves past the comma, and inserts a quote after. Handles CSV quoting.

Next

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