How to replace letters with carriage returns on VIM
Tags administration, unix, vim, words
Problem:
A text file coms with a list comes with the items separated by commas, like:
We need them in column form, like:
Solution:
:%s/,/{[Ctrl+v], then [Enter]}/g
Notes:
A text file coms with a list comes with the items separated by commas, like:
Quote:
a,b,c....
Quote:
a
b
c
b
c
:%s/,/{[Ctrl+v], then [Enter]}/g
Notes:
- The % before s, indicates that the range where the replacement is to take place is the whole document.
- Ctrl and v are pressed simultaneously, and then the character we mean vim to use (in this case Return).
- The g at the end of the expression indicates that every occurrence on the line where the comma is found is to be replaced (as opposed to only the first occurrence).