Re: vi editor related question
+++ Soo-Hyun Choi [freebsd] [28-08-04 00:52 +0100]: | 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? And, does anyone can tell me how to avoid this kind of | things? | | Cheers, | | -- col -bs oldfile newfile Regards, Shantanu ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: vi editor related question
Consider using a different editor in windows like UltraEdit. It can save in unix format and supports syntax hi-lighting. Better yet, remove windows from the equation. :) There are a lot of nice text editors for UNIX like OSes including xemacs, gedit (gnome), kate (kde), etc. I do understand the temptation to use a specific editor though. For large class assignments (C++), I often work on my laptop using xcode (apple). Fortunately, Apple switched to the winning team (UNIX) for line termination with OSX. On Aug 27, 2004, at 7:52 PM, 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? And, does anyone can tell me how to avoid this kind of things? Cheers, ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED] Lucas Holt [EMAIL PROTECTED] FoolishGames.com (Jewel Fan Site) JustJournal.com (Free blogging) ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: vi editor related question
On Sat, Aug 28, 2004 at 09:20:54AM +0530, Subhro wrote: I have come across a script (Perl) called dos2unix. You can check that out too. Google for the link. Regards S. It's in the Ports tree: textproc/unix2dos. Simply do: dos2unix filename if you want to edit the file under FreeBSD (UNIX), and unix2dos filename if you want to edit it under Windows (DOS). GH ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: vi editor related question
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 ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: vi editor related question
in message [EMAIL PROTECTED], wrote Soo-Hyun Choi thusly... I edit ... certain text editor under Windows XP, and then I open ... 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? Cause is the default line ending on Windows being different than on Unix/FreeBSD. And, does anyone can tell me how to avoid this kind of things? Use an editor on Windows that saves the file as w/ Unix line ending. Or, use an editor on FreeBSD, like vim 6 from the ports, that will hide/change '^M' characters. Other methods is to preprocess your files... http://groups.google.com/groups?q=remove+%5EM+file http://groups.google.com/groups?q=remove+%5EM+group%3Acomp.* - Parv -- ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: vi editor related question
On Fri, 2004-08-27 at 20:46, Parv wrote: in message [EMAIL PROTECTED], wrote Soo-Hyun Choi thusly... I edit ... certain text editor under Windows XP, and then I open ... 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? Cause is the default line ending on Windows being different than on Unix/FreeBSD. And, does anyone can tell me how to avoid this kind of things? Use an editor on Windows that saves the file as w/ Unix line ending. Or, use an editor on FreeBSD, like vim 6 from the ports, that will hide/change '^M' characters. Other methods is to preprocess your files... http://groups.google.com/groups?q=remove+%5EM+file http://groups.google.com/groups?q=remove+%5EM+group%3Acomp.* - Parv If you are using plain vi, you can get rid of the unwanted characters with the command :1,$s/ctrl-v-m//g where ctrl-v-m' means hold down the Ctrl key while you press v followed by m. You will see them magically disappear. ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: vi editor related question
On Fri, Aug 27, 2004 at 10:52:04PM -0400, Mike Jeays wrote: If you are using plain vi, you can get rid of the unwanted characters with the command :1,$s/ctrl-v-m//g where ctrl-v-m' means hold down the Ctrl key while you press v followed by m. You will see them magically disappear. Another way to do this: %s/\r// (% - act on all lines) -Radek ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: vi editor related question
I have come across a script (Perl) called dos2unix. You can check that out too. Google for the link. Regards S. On Sat, 28 Aug 2004 05:46:04 +0200, Radek Kozlowski [EMAIL PROTECTED] wrote: On Fri, Aug 27, 2004 at 10:52:04PM -0400, Mike Jeays wrote: If you are using plain vi, you can get rid of the unwanted characters with the command :1,$s/ctrl-v-m//g where ctrl-v-m' means hold down the Ctrl key while you press v followed by m. You will see them magically disappear. Another way to do this: %s/\r// (% - act on all lines) -Radek ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED] -- Subhro Sankha Kar School of Information Technology Block AQ-13/1 Sector V ZIP 700091 India ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]