This is the mail archive of the
mailing list for the Cygwin project.
Re: Unix/DOS text mode?
- From: Michael Schaap <cygwin at mscha dot org>
- To: cygwin at cygwin dot com
- Date: Thu, 22 Nov 2001 23:05:01 +0100
- Subject: Re: Unix/DOS text mode?
The default value of "fileformats" depends on whether the "compatible"
option is set.
If it is, then fileformats="", so file format autodetection is disabled.
If it isn't, then fileformats="unix,dos".
(This is for the UNIX version (including Cygwin). The Windoze native
version uses "dos,unix" in both cases.)
If a .vimrc exists, even if it is empty, "nocompatible" will be set,
otherwise "compatible" will be set.
So, a default installation of vim on Cygwin will not enable file format
(Source: ":help compatible".)
At 20:07 22-11-2001, Joshua wrote:
>Corinna et al,
>Strangely enough, my vim does *not* start up with the
>fileformats=dos,unix option either. However, adding
>that switch to .vimrc does the trick. I wonder where
>your installation is getting that option set at?
>From: Corinna Vinschen <cygwin at cygwin dot com>
>To: cygwin <cygwin at cygwin dot com>
>Date: Wed, 21 Nov 2001 11:16:43 +0100
>Subject: Re: Unix/DOS text mode?
>On Wed, Nov 21, 2001 at 10:43:29AM +0100, Bjoern Kahl
>AG Resy wrote:
> > Hallo !
> > On Wed, 21 Nov 2001, Corinna Vinschen wrote:
> > On Tue, Nov 20, 2001 at 07:54:47PM -0600, Joshua
> > > > I think I'm being a bit dense on this issue
>for which I apologize. What
> > > > option needs to be set to have the
>Cygwin-packaged vim autodetect
> > > > binary/text files and edit/save accordingly? My
>.vimrc is a binary file,
> > > Nothing. It should work automagically. Which it
>does on my system.
> > > I've just tested it explicitely since your
>postings made me nervous.
> > Hmm. At least for the version I installed last
> > "install now" (aka setup) on the cygwin site) did
> > I have had to copy
> > ".vimrc" to my $HOME and add the line "set
> > under the line "set nocompatible".
>Interesting. I have no such option set explicitely.
>vi and then call `:set fileformats', the output is
>And this is the default setting on Unix systems.
>Cygwin is treated as
>a Unix system by vim.
> > > However, the unix/dos file recognition works based
>on examining only
> > > the first line, AFAIK, so if the first line has
>only a LF instead of
> > > an CRLF for some reason, vim treats the file as
>unixy. Then you see
> > > the ^M beginning with line 2.
> > My english is somewhat limited, but as I understand
> > in vim doc-folder, vim reads the whole file dicides
>on how many <CR>,
> > <CR><NL> and >NL> it found. (However, that chapter
>in the docs is not
> > really clear to me).
>You're right. It examines the whole file but the
>notes are clear:
>- If _all_ lines end in CRLF, it's treated as dos
>- If _one_ line is found with only a LF, unix is
>preferred over dos.
>Corinna Vinschen Please, send mails
>regarding Cygwin to
>Red Hat, Inc.
>Do You Yahoo!?
>Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
>Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
>Bug reporting: http://cygwin.com/bugs.html
I always wondered about the meaning of life. So I looked it
up in the dictionary under "L" and there it was - the meaning
of life. It was not what I expected. - Dogbert
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html