I want to join all lines in a file into a single line. What is the simplest way of doing this? I've had poor luck trying to use substitution (\r\n
or \n
doesn't seem to get picked up correctly in the case of s/\r\n//
on Windows). Using J
in a range expression doesn't seem to work either (probably because the range is no longer in 'sync' after the first command is executed).
I tried :1,$norm! J
but this only did half of the file - which makes sense because it just joins each line once.