Gene Kwiecinski wrote: >>>> "fileformats=dos,unix", so both formats are available, yet the >>>> detection and switching does not seem to work. > >>> Are you sure _every_ line ends in "^M"? > >> Positive. Every single line shows an ^M at the end. "set fileformat" >> gives "unix" after loading. Setting fileformat to "dos" doesn't change >> the files interpretation in vim. Somehow I think I miss something. > > Uhhh, don't think it *should* automagically delete the ^Ms. I'm always > running into that, and in addition to an almost reflexive alt-EIFD to go > dos-mode, I *still* always have to ':s/^V^M' to get rid of 'em, and I'm > using version 6.4, not even 7.x, so it's definitely been around for a > while.
If vim opens a file that truly has ^M^J at the end of every line, and fileformats contains dos, then it will automatically convert ^M^J to "line ending". If you then set ff=unix, and save the file, it will write those endings out as just ^J. I've used this a few times (also in reverse, when I want to write an SMTP transcript for netcat, but forgot to save with CRLFs the first time :) ). -- Micah J. Cowan Programmer, musician, typesetting enthusiast, gamer... http://micah.cowan.name/
signature.asc
Description: OpenPGP digital signature