Deleting dos chars using Vim (^M)
Hello,
IF you want to delete dos chars using Vim instead of installing external tools like dos2unix,tr,sed,awk etc.. you can do that using Vim syntax like this:
:set ff=unix //to unix file
:set ff=dos //to windows file
See you!
UPDATE
If you want to do mass conversions, you can use this command lines switches and let vim do the work :)
vim +"set ff=unix" +wq $DOS_FILE
on November 30, 2007 on 14:03
Sweet! This is far simpler than my method. Thanks :D
on October 21, 2009 on 20:04
Not sure if it’s the version of vim i’m using, but this doesn’t work for me. I still have the ^M char at the end of lines. I’ve just been using :%s/.$// to remove the ^M