vim Converting text files from DOS to UNIX with vi Using VIm's fileformat


Example

When Vim opens a file with <CR><NL> line endings (common on MSDOS based operating systems, also called CRLF) it will set fileformat to dos, you can check what with:

:set fileformat?
  fileformat=dos

Or just

:set ff?
  fileformat=dos

To convert it to <NL> line endings (common on most UNIX based operating systems, also called LF) you can change the fileformat setting and Vim will change the buffer.

:set ff=unix