On Fri, 2007-04-13 at 09:42 -0600, Joseph Hall wrote: > Window and DOS use <CR><LF> as its end of line marker, whereas Unix > and Linux only use <LF>. When you open a Windows file in something > such as vi in Linux, you get ^M at the end, which represents the <CR>.
Depending on your vi, you may not even see the ^M. VIM for example is smart enough to detect DOS file endings and will use the alternate form. When you open such a file you'll see "[DOS]" down in the status line, indicating that's what happened. You can force one or the other with ":set ff=dos" or ":set ff=unix" before you ":w". There is the problem of what to do if half the line endings are <CR><LF> and half are <LF>. In that case I think VIM assumes Unix mode and will show ^M on any line that has it. Use ":s/^V^M//" to fix it, as mentioned elsewhere in this thread. Corey /* PLUG: http://plug.org, #utah on irc.freenode.net Unsubscribe: http://plug.org/mailman/options/plug Don't fear the penguin. */
