Sunday, December 29, 2013

Re: Question about set fileformats

On 29/12/13 10:14, Niels Kobschätzki wrote:
> Hi,
>
> to fix a problem with another application I need to set the following in my .vimrc:
>
> set fileformats=unix,dos,mac
>
> I know what it does but I wonder if there are any disadvantages with this and if no, why isn't it set by default?
>
> Niels
>
>
It is set by default to almost that (to "mac,unix,dos") on Mac, or at
least it used to be on Mac OS9, I'm not sure it still applies to Mac OSX
which is a Unix-like OS.

I'm not sure which disadvantages there might be. Note that the
heuristics is a littled skewed in favour of Unix against Dos, and in
favour of either of them against Mac. You should study ":help
'fileformats'" if you want to get an understanding of how it works.

If you know which fileformat should be used to read a given file, you
can always open it with e.g.

:e ++ff=mac foobar.txt

see :help ++opt

In particular, files which lack an end-of-line on the last line (as
often happens on Windows with other editors) will always be opened as
Unix-format even if all other lines end in <CR><LF>. You can correct
that by opening them with ++ff=dos which will treat either <CR><LF> or
<LF> alone (or nothing on the last line) as an end-of-line, and will, on
writing, use <CR><LF> on all lines.


Best regards,
Tony.
--
The Briggs-Chase Law of Program Development:
To determine how long it will take to write and debug a
program, take your best estimate, multiply that by two, add
one, and convert to the next higher units.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment