Clan x86

Technical (Development, Security, etc.) => Unix / Linux Discussion => Topic started by: rabbit on May 05, 2006, 07:54:36 PM

Title: Gvim
Post by: rabbit on May 05, 2006, 07:54:36 PM
How can I make it accept Windows line endings instead of displaying ^M?
Title: Re: Gvim
Post by: Newby on May 05, 2006, 08:22:14 PM
IIRC you can't.

tr -d '\r' < inputfile.txt > outputfile

That should work. :)

EDIT -- Google FTW! http://vi-improved.org/wiki/index.php/FileFormat
Title: Re: Gvim
Post by: rabbit on May 05, 2006, 09:38:00 PM
Any way to do it automatically?  I'm working on a website and I want to be able to edit it here and at school (Windows) without converting back-and-forth all the time..
Title: Re: Gvim
Post by: Joe on May 06, 2006, 12:19:52 AM
You could create a shellscript to translate to UNIX, edit, and then translate to Windows.

Or you could use gedit, but that's another story.
Title: Re: Gvim
Post by: rabbit on May 06, 2006, 07:41:48 AM
I don't use Gnome -.-;;  but I'll give it a shot.

[edit]
Gedit update:
despite installing gnome-doc-utils, I get the following:
checking for GDU_MODULE_VERSION_CHECK... Package gnome-doc-utils was not found in the pkg-config search path.
Perhaps you should add the directory containing `gnome-doc-utils.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gnome-doc-utils' found
configure: error: Package requirements (gnome-doc-utils >= 0.3.2) were not met.
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively you may set the GDU_MODULE_VERSION_CHECK_CFLAGS and GDU_MODULE_VERSION_CHECK_LIBS environment variables
to avoid the need to call pkg-config.  See the pkg-config man page for
more details.
Title: Re: Gvim
Post by: iago on May 06, 2006, 09:29:38 AM
For some reason, after creating ~/.vimrc with the following commands:

:syn on
:set tabstop=4

It stopped complaining about Windows' endlines. 

I think I may have written a shellscript at some point to fix it, and posted it here or at vL.  But that was a long time ago.  It shouldn't be very hard to do. 
Title: Re: Gvim
Post by: rabbit on May 06, 2006, 01:56:12 PM
You're right :P  Thanks.