On 2011-06-07, ANDY KENNEDY wrote:
> <snip>
> 
> > >
> > > au BufNewFile,BufRead Kconfig.*                 call
> > s:StarSetf('kconfig')
> > >
> > > In stead?
> > >
> > > If you know of a fix for this, please pass it along to me.
> > 
> > To start with, never modify any file under $VIMRUNTIME. It may be
> > overwritten by an update to Vim within the same revision (e.g.,
> > 7.3.x) and will be ignored if you update Vim to a new revision
> > (e.g., 7.2 to 7.3).
> 
> Only, however, if _I_ update it.  I don't use a flavor of Linux
> that self updates.

True, but if you decide to update, you don't know in advance which
files may be replaced.  Suit yourself, but there's no point in
making more work or surprises for yourself.

> > If Vim's decision about the type of a particular file is not what
> > you want, there are two standard solutions described under
> > 
> >     :help new-filetype
> > 
> > sections A and C.  Which method you should choose depends on the
> > number of filetype rules you intend to add or modify.  If the
> > number
> > is small, section A, using a file under ~/.vim/ftdetect is easier.
> > If the number is large, section C, creating your own
> > ~/.vim/filetype.vim is probably better.  For method A, your
> > ~/.vim/ftdetect/kconfig.vim file would look like this:
> > 
> >     au BufRead,BufNewFile Config.in set filetype=kconfig
> 
> ::sighs::  This worked.  I don't understand why this works, however.
> Is this because these commands are post processed, and (for some
> reason) are evaluated before the defaults?  If that is the case,
> then I understand why it picks up the filetype correctly.

The commands in the ~/.vim/ftdetect directory are processed after
the defaults (see ":help ftdetect", the paragraph below the line
labeled "<  3"), but the 'filetype' is set by the "set filetype"
command regardless of any previous setting of 'filetype' by "set
filetype" or "setfiletype", so it prevails.

> > HTH,
> > Gary
> 
> Yes it did help, Thank you so much.

You're most welcome.

Regards,
Gary

-- 
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