There are a couple of problems here.
Firstly, you are using the
:setfiletype command, which only sets the
'filetype' if it has not already been set. (See
If you change your autocommand to set the
'filetype' directly with
:set filetype=python, this will result in the
python filetype being used, as you desire.
However, this still isn't perfect, because now Vim is first setting the
conf (based on its contents) and then changing it to
python, and it's possible that some options are set for
conf files that you do not want in
To avoid this, follow the instructions in section C of
:help new-filetype to detect this filetype before the installed detection runs by creating a
.vim/filetype.vim file with the following contents:
" my filetype file
autocmd! BufRead,BufNewFile SCons* setfiletype python
I'd also note that it's not really a bug that Vim is using a
conf here. Vim's runtime files set a large number of types automatically, but they cannot automatically set the types of all files, now and in the future. This is why the mechanisms described in the documentation linked to above exist: to allow you to add
filetype detection for currently unsupported files as necessary.
It is of course, reasonable to suggest that it be added as a feature request: hopefully automatic detection of SCons files will be added in future versions!