On Mon, Dec 01, 2003 at 08:07:37PM -0800, Reid Kleckner wrote:
> When one edits a text file with carriage return line
> breaks, if the one at the very end of the file is
> missing Vim doesn't recognize the file as being Mac
> format. This is especially troublesome when working
> with BBEdit users, because by default at least it
> doesn't put a line break at the end of the file.
> Surely this is a flaw, or is there some other reason
> for this strange behavior? Unix and DOS file formats
> work when they are missing their final line break, but
> not on Mac.
Are you sure you have diagnosed this correctly? I tried the
following experiment (on my Linux box, but it should work the same on
any platform ... should ...)
$ vim foo.txt
I now have a file with Mac-style line endings. I want vim not to
I have one long line with a <C-M>, displayed as ^M, at the end (and
several in the middle). I delete the final one and then ...
Now I have a file with Mac-style line endings, properly recognized by
vim, with a single <C-J>, displayed as ^J, at the end.
Have you read the description under
about how vim decides what the file format is?
HTH --Benji Fisher