[NBLUG/talk] vim fileformat

Barry Stump barry.stump at gmail.com
Mon Sep 11 13:42:27 PDT 2006


I have some files whose format is mis-detected by vim.  They were
origionally dos format (lines ending with \r\n) but somewhere along
the way they had the occasion unix format (\n) line ending added.
Now, when opening them up in vim, I see all the annoying ^M characters
because it thinks (incorrectly) that they are unix format.

I know that I can use
:set fileformat=dos
to change the file format, but because of source control, I can't just
save the file and reload it to see the changes.  How do I get vim to
change the format and re-process the buffer in place so that the
display of the ^M characters go away without changing the actual file?
 Alternatively, a vim command line parameter to force it to read the
file as a certain format would also work, if such a thing exists.

Anyone know any vim magic that can help?

-Barry



More information about the talk mailing list