At the vim prompt following would work globally
:%s/\n//g
If you are new to vim, make sue you have pressed Esc key. This will take you to the control mode, Then type :, your cursor will o to the bottom of the window with : prompt. There you can enter the command I provided.
If you want to replace for a few lines, select the lines using ctrl-V and use the command s/\n//g