Replace all commas with new lines
From Vim Tips Wiki
(Redirected from VimTip877)
[edit] Obsolete tip
This tip has been merged into another tip.
See VimTip667 for the current tip.
Please do not edit this tip, and do not edit the discussion page.
If anything needs to be improved, please fix VimTip667.
Tip 877 • Previous Tip • Next Tip
Created: February 17, 2005 Complexity: intermediate Author: Roumen Semov Minimum version: 6.0 Karma: 9/27 Imported from: Tip#877
Enter one of the following commands to change a comma-separated list of items into a list where each item is on its own line.
" Change CSV items on current line to a list of separate items. :s/,/\r/g " Same, for all lines. :%s/,/\r/g
CSV is comma-separated values (for example, "red,green,blue").
In the replace text of a substitute, \r substitutes a newline.
