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

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

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


Got any vim Question?