I have an interview transcript with continuous text. At times, the names of the person speaking are written (Aron:, Kalle:, Tomas: etc.). I want to insert a line break before every name that is followed by a colon (:) (names, which I specify).
How can I script this in VIM so that when I run the command, it goes through the entire text file and insert those extra linebreaks?
In other words, I want to turn this:
Aron: bla, bla, bla
Kalle: yes, yes, yes
into:
Aron: bla, bla, bla
Kalle: yes, yes, yes
Try this simple command:
g/^/will match every line, then exec command below.pu _will put the text from register_(the black hole register) after current matched line.You can also use the
:substitutecommand:Yet another one which uses external
sed:All commands have the same length. Pick one you like.