If you open files that were created in Windows and the lines all end with ^M, you can delete them with one of the following approaches:
- dos2unix is a command line utility that will convert DOS line endings to Unix line endings
- In Vim, you can run
:%s/^M//g, but you must typeCtrl-v Ctrl-mto input the^M. - You can also run
:set ff=unixto make Vim do this automatically.
Alternatively, if you move files back and forth a lot, you might not want to convert them, but rather to do :set ff=dos, so Vim will know it’s a DOS file and use DOS conventions for line endings.
Help: If there are any further questions, or there is an issue with the documentation, please submit a ticket or contact us on Slack for additional assistance.