in reply to I must be going *insane*!
in thread Debugging: What's going on here?

vim automatically recognizes DOS-style end-of-lines and treates them correctly. To force it to use unix-style EOLs, set the "filetype" variable to "unix":
:set ff=unix
Then write the file. It will write it in Unix format. If you set ff=unix before loading a file, it should show the \r's as ^M.

--ZZamboni