| From | Sent On | Attachments |
|---|---|---|
| Aaron | Oct 24, 2006 8:01 am | |
| A.J.Mechelynck | Oct 24, 2006 8:57 am | |
| Aaron | Oct 24, 2006 9:06 am | |
| Yakov Lerner | Oct 24, 2006 9:26 am | |
| Bram Moolenaar | Oct 24, 2006 9:27 am | |
| A.J.Mechelynck | Oct 24, 2006 9:36 am | |
| Aaron | Oct 24, 2006 9:38 am | |
| Aaron | Oct 24, 2006 9:51 am | |
| Gary Johnson | Oct 24, 2006 10:08 am | |
| A.J.Mechelynck | Oct 24, 2006 10:10 am | |
| Marvin Renich | Oct 24, 2006 10:11 am | |
| Aaron | Oct 24, 2006 10:13 am | |
| Aaron | Oct 24, 2006 10:25 am | |
| A.J.Mechelynck | Oct 24, 2006 10:35 am | |
| Matthew Winn | Oct 25, 2006 3:24 am | |
| Yakov Lerner | Oct 25, 2006 5:17 am | |
| Vigil | Oct 26, 2006 2:42 am | |
| Vigil | Oct 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 | |
Aaron wrote:
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.
-- Aaron "The Dude abides."





