vi editor related question

Kevin D. Kinsey, DaleCo, S.P. kdk at
Fri Aug 27 17:25:17 PDT 2004

Soo-Hyun Choi wrote:

>I edit C++ codes with a certain text editor under Windows XP, and then
>I open the C++ codes using vi editor under FreeBSD. Then, there are
>bunch of "^M" sign at the end of each line. Does anyone know why this
>is happening? 

Microsoft has chosen (for a long time now) to ignore the standard
line feed, instead replacing "LF" with "CR/LF".  There are lots of
ways to deal with this.  Personally, I finally just picked a 'Nix editor
that grokked it and automatically converts it to "LF".  I can't
imagine that vi couldn't do this; but I don't use it and therefore
I don't know.

But there's hope ... just a pinch of Google ... here's a freebie:

>And, does anyone can tell me how to avoid this kind of

Stop using Windows ;-)


Kevin Kinsey

More information about the freebsd-questions mailing list