I wrote a document in vim with textwidth=80. I would now like to paste this document into libreoffice for formatting. The problem is the line breaks. In libreoffice the lines are too short because of the newlines inserted by vim after 80 characters.
I separate paragraphs using two newline characters (i.e. hitting return twice). Is there any way I could remove all the single \n characters while retaining the \n\n characters?
:%s/\n\{2,}/\rSomemarkerNotFoundElsewhereInTheText\r/e
to replace all double newlines with a marker, followed by:%j
to join all line and%s/SomemarkerNotFoundElsewhereInTheText/^M^M/g
to replace the marker. Ugly as hell and I am sure there is a better way.