Aaron wrote:
[...]
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.


You can use the path in the autocommand "filename" pattern, e.g.

        au BufWritePre  */custom_tags/*.cfm setl bin
        au BufWritePost */custom_tags/*.cfm setl nobin

See for instance the autocommand set by default for etc/a2ps/*.cfg at the BufRead and BufNewFile events.


Best regards,
Tony.

Reply via email to