delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/11/21/05:17:38

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Wed, 21 Nov 2001 11:16:43 +0100
From: Corinna Vinschen <cygwin AT cygwin DOT com>
To: cygwin <cygwin AT cygwin DOT com>
Subject: Re: Unix/DOS text mode?
Message-ID: <20011121111643.M21630@cygbert.vinschen.de>
Mail-Followup-To: cygwin <cygwin AT cygwin DOT com>
References: <20011121102822 DOT E21630 AT cygbert DOT vinschen DOT de> <Pine DOT GSO DOT 4 DOT 40 DOT 0111211032100 DOT 1160-100000 AT domino DOT informatik DOT uni-kl DOT de>
Mime-Version: 1.0
User-Agent: Mutt/1.2.5i
In-Reply-To: <Pine.GSO.4.40.0111211032100.1160-100000@domino.informatik.uni-kl.de>; from kahl@informatik.uni-kl.de on Wed, Nov 21, 2001 at 10:43:29AM +0100

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 wrote:
> > >     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 friday (using
>  "install now" (aka setup) on the cygwin site) did *not* work.
>  I have had to copy "/usr/share/vimv/im60/vimrc_example" as
>  ".vimrc" to my $HOME and add the line "set fileformats=unix,dos"
>  under the line "set nocompatible".

Interesting.  I have no such option set explicitely.  When opening
vi and then call `:set fileformats', the output is

  fileformats=unix,dos

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 the "options.txt"
>  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 file.
- If _one_ line is found with only a LF, unix is preferred over dos.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019