On 2/28/07, asdasd asdasd <[EMAIL PROTECTED]> wrote:
--- Yakov Lerner <[EMAIL PROTECTED]> wrote:
> Do you need to pass the vim setting into your script
> ?
It may be one way to solve my problem. I still think
requesing vim to reconsider its EOL policy when
substituting a buffer (i.e., when running txt2ext on
the BufWritePre autocommand) would be more elegant.


> You can do this using the environment variable.
> vim can set environment variables (:let $NAMe=value)
> and script can test them. For example, :let
> $EOF=&eol
Let's assume my txt2ext script is as follows:

---------------
#!/bin/sh
echo "0\r\n"
---------------

Note that it always produces EOL at the end of the
data. If the original binary file didn't have an EOL,
the saved binary won't have it either, but the script
did produce it.

So use "echo -n" ( or write your  perl which does not add "\n"
where you do not want them.) How is that a problem of vim if your
script adds newlines where you do not want them ?

Also, take a look the the tip
http://www.vim.org/tips/tip.php?tip_id=1369
Tip #1369: save file that had missing-trailing-end-of-line
automatically without trailing-end-of-line

Yakov

Reply via email to