On 2006-10-24, Aaron <[EMAIL PROTECTED]> wrote:
> A.J.Mechelynck wrote:

> > yes, that should work if you're dead set on writing a file without a
> > final EOL. You might even automate it further by defining
> > autocommands: let's say that particular filetype is identified by
> > extension .xyz -- then you can define
> >
> >     :autocmd BufWritePre  *.xyz setlocal binary
> >     :autocmd BufWritePost *.xyz setlocal nobinary

> You beat me to it, I was halfway through reading the autocommands help
> entry when this came through. Thanks, Yakov, for suggesting this.
> 
> Here's a thought, though. There is nothing in the file type or filename
> that will indicate that it is a custom tag, but the file will *always*
> live in /some/path/custom_tags/myfile.cfm. That's where the CF server
> will look for custom tags so they have to be there by design.
> 
> So perhaps I can do something like:
> 
> au BufWritePre *.cfm call MaybeSetBinary()
> au BufWritePost *.cfm call MaybeUnsetBinary()
> 
> fun! MaybeSetBinary()
>   if match(expand('%'),'custom_tags') > -1
>     setlocal binary
>   endif
> endfun
> 
> fun! MaybeUnsetBinary()
>   if match(expand('%'),'custom_tags') > -1
>     setlocal nobinary
>   endif
> endfun
> 
> I'll do some experimentation. Thanks again Yakov and Tony.

    :autocmd BufWritePre  /some/path/custom_tags/myfile.cfm setlocal binary
    :autocmd BufWritePost /some/path/custom_tags/myfile.cfm setlocal nobinary

See

    :help autocmd-patterns

Gary

-- 
Gary Johnson                 | Agilent Technologies
[EMAIL PROTECTED]     | Wireless Division
                             | Spokane, Washington, USA

Reply via email to