Vim is a great editor. I don’t want to start an EMACS versus vim flame war here. It is just personal preference: I “get” vim, whereas EMACS confuses me.
Anyway, here’s a clever little tip for users of vim that often have to open both DOS and UNIX format files (you know, the old ^M line feed problem):
While in the editor you can write out either format.
:set ff=unix
:w
Sets the file to UNIX linefeeds, while
:set ff=dos
:w
Sets them to DOS. Enjoy!


In vi:
:%s!^M!!g’
That is all.
Wouldn’t that remove the linefeed instead of replacing it with the right one?