Friday, March 24, 2017

RE: Edit a Mac file with 0x13 CR newlines on Windows?

-----Original Message-----
>> Is it possible on Windows to edit a old-style, pre-OS/X file from a Mac that uses 0x0D (CR) as the newline? If so, how?
>>
>> Does this have something to do with 'set ffs='?
>
>Yes. The 'fileformats' option specifies which fileformat(s) you want Vim to recognize. It is a comma-separated list: >
>
>unix: each line ends with a single <NL>, 0x10
>dos: each line ends with a <CR><NL> pair, 0x13 0x10 in that order.
>mac: each line ends with only a <CR>, 0x13.
>
>Depending on the option's value, Vim will try to determine the 'fileformat' used for the file and set that. Note that Windows
> (dos-format) files lacking an end-of-line on their last line will usually be detected as "unix" if 'fileformats' includes it, displaying a ^M at the end of all other lines, and that when trying to read a file as "dos" (either because the option does not include "unix" or because you forced dos >mode, see below) lines lacking a <CR> before the <NL> will be silently accepted.
>
>To force a certain fileformat, add e.g. ++ff=mac between the command (:edit, :new, :vsplit, etc.) and the filename.
>
>
>See:
> :help 'fileformats'
> :help 'fileformat'
> :help file-formats
> :help ++opt

Many thanks to Tony Mechelynck and John Beckett.

*-*-*- Presbyterian_Healthcare_Services_DISCLAIMER -*-*-*
This message originates from Presbyterian Healthcare Services or one of its affiliated organizations.
It contains information, which may be confidential or privileged, and is intended only for the individual or entity named above. It is prohibited for anyone else to disclose, copy, distribute or use the contents of this message. All personal messages express views solely of the sender, which are not to be attributed to Presbyterian Healthcare Services or any of its affiliated organizations, and may not be distributed without this disclaimer.

If you received this message in error, please notify us immediately at info@phs.org
If you would like more information about Presbyterian Healthcare Services please visit our web site http://www.phs.org

--
--
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/d/optout.

No comments: