atom feed18 messages in com.googlegroups.vim_useRe: Binary files, noeol, and other su...
FromSent OnAttachments
AaronOct 24, 2006 8:01 am 
A.J.MechelynckOct 24, 2006 8:57 am 
AaronOct 24, 2006 9:06 am 
Yakov LernerOct 24, 2006 9:26 am 
Bram MoolenaarOct 24, 2006 9:27 am 
A.J.MechelynckOct 24, 2006 9:36 am 
AaronOct 24, 2006 9:38 am 
AaronOct 24, 2006 9:51 am 
Gary JohnsonOct 24, 2006 10:08 am 
A.J.MechelynckOct 24, 2006 10:10 am 
Marvin RenichOct 24, 2006 10:11 am 
AaronOct 24, 2006 10:13 am 
AaronOct 24, 2006 10:25 am 
A.J.MechelynckOct 24, 2006 10:35 am 
Matthew WinnOct 25, 2006 3:24 am 
Yakov LernerOct 25, 2006 5:17 am 
VigilOct 26, 2006 2:42 am 
VigilOct 26, 2006 2:49 am 
Subject:Re: Binary files, noeol, and other such things.
From:Aaron (aar@thebailiwick.com)
Date:Oct 24, 2006 10:25:55 am
List:com.googlegroups.vim_use

A.J.Mechelynck wrote:

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.

Brilliant! I suspected this, but didn't see a specific mention of it in the autocommand help. I will probably put this in my .vimrc right now.

Cheers!

I just want to say that your settings there work a treat! Autocommands are my new best friend.