vi editor related question

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


Soo-Hyun Choi wrote:

>Hi,
>
>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:

http://icarus.weber.edu/home/bob/cs213/rm_ctr_m.html


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


Stop using Windows ;-)

HTH,

Kevin Kinsey



More information about the freebsd-questions mailing list