If you have a nasty DOS file and you wish to convert the it from any mixture of CRLF/LF-only line endings, so all lines end with LF only:
Save any changes.
:w
Edit file again, using dos file format (‘fileformats’ is ignored).
:e ++ff=dos
This buffer will use LF-only line endings when written.
:setlocal ff=unix
Write buffer using unix (LF-only) line endings.
:w