I have "set fileformats=unix,dos" at the bottom of my _vimrc,
but still see the ^M's.

My guess is that the file in question has one line that lacks a ^M in the line, and thus, it vim concludes that it must use unix-style line-endings. The likely culprit is the last line in the file.

You can clean them all up with

        :%s/^M$/

where ^M is entered by pressing ^V followed by ^M

Once you've gotten them all cleaned up, you can use

        :set ff=dos

and then write the file.

If problems keep cropping up in files, somebody else's editor is likely bunging stuff up.

-tim


Reply via email to