ANDY KENNEDY wrote the following on 07.06.2011 20:01

Hello,

> <snip>
> 
>> Do you have a real world example. I would like to have a look at
>> that.
>> The example would include the file you want to detect and the path
>> where one would find it. Thanks.
> 
> Sure, I'm only attaching the Config.in file.  To make the change
> to the filetype.vim file is simple, just add *onfig.in to the
> Kconfig au line (around 946).
> 
> The attached file was originally from the Linux kernel source --
> the drivers dir Kconfig file I renamed to Config.in, then added
> a comment block to the top.  You can reproduce using any Kconfig
> file renamed to Config.in (which is what BuildRoot calls their
> Kconfig files) and throw in a comment block of about 4 lines or so.
> 
> Hopefully, the attachment will not be mangled by LookOut, but if
> so, you have the formula to reproduce it.
> 
> Andy

sorry to come back to you so late. I have been rather busy lately.

'Config.in' is by default detected as filetype 'conf' which is afaict s.th. like
a catch-all filetype for everything that isn't defined in 'filetype.vim' 
already.

Adding 'Config.in' to filetype.vim (actually line 936 over here) still leads to
ft=conf, no matter how many lines of comments are on top of the file.
This is due the code block starting at line 2463 in filetype.vim.

Adding the line:
,----[  .vimrc  ]--------

au BufNewFile,BufRead Kconfig,Kconfig.debug,Config.in   setl ft=kconfig
`---------------------------------------------

does what you want.

But actually i am not able to reproduce the error you described with:
> HOWEVER, for some strange reason if there is a comment at the top of
> the file, the file is no longer recognized as a Kconfig file, but as
> a <something> source file. 

Guess there must be some local settings {and,or} plugins that do that.

For now i don't see a  bug in default vim filetype settings.

HTH
-- 
bye Thilo

4096R/0xC70B1A8F
721B 1BA0 095C 1ABA 3FC6  7C18 89A4 A2A0 C70B 1A8F


-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui