In vim, I want to replace newlines with the literal string \n.
For example, if I open a file that contains this text:
This is line one
This is line two
I want to replace the newlines and have the following:
This is line one\nThis is line two
How can I achieve this?
vim? Can it just usesedon the file itself?