Daniel Fetchinson schrieb:
> Hi folks,
>
> I'm using vim 7.1 and for some reason when I open something.javascript
> vim detects it correctly that it is a javascript file and applies the
> necessary highlighting but when the same file is renamed to
> something.js vim doesn't detect it automatically. If I say
>
> :filet detect
>
> the highlighting is applied correctly. With any other filetype (C,
> python, etc) automatic highlighting works, I only have to say it
> manually (:filet detect) for .js files. Why is this?
>
> There are these lines in /usr/share/vim/vim71/filetype.vim
>
> " JavaScript, ECMAScript
> au BufNewFile,BufRead *.js,*.javascript,*.es setf javascript
>
> which would make me think that both file extensions are wired up to be
> detected as javascript. And I have in my ~/.vimrc
>
> filetype plugin on
> syntax on
>
> And nothing js or javascript related in the same file. Does anyone
> have an idea what's going on?
Does Vim detect something else for *.js files?
:e myfile.js
:set ft?
or
:verb au * *.js
especially
:verb au filetypedetect * *.js
In your 'runtimepath', there might be other filetype.vim scripts or
ftdetect/*.vim files overwriting expected settings.
Also check
:scriptnames
--
Andy
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---