I wish Vim internally supported nul (00) line endings,
but alas.

You might be able to set up a before/after filter, much like the gzip example (":help gzip-example"), using tr, of the form

        tr '\000\012' '\012\000'

This will swap all NUL characters in the file and 0x0A (octal 012) characters. Vim can then interpret the file normally with the NUL characters as the line-breaks. Then, before writing the file, pipe it through the same "tr" command to reswap your null bytes and your place-holder character.

You don't have to use a LF/0x0A as your alternate byte...as a matter of fact, it might be best to use a character that doesn't occur anywhere in your source file, and that Vim isn't likely to have conniptions about. I'd adjust accordingly.

Just a few ideas for how to make Vim use NUL characters as line delimiters :)

-tim





Reply via email to