>>> Hi,
>>> I usenesC'sfiletype detection, which works fine if I use "vi
>>> filename.nc" to edit a file. However, if I'm already in the vim
>>> environment, and use ":e filename.nc" to open a file, there is no
>>> syntax highlight. I searched a long time but cannot fix it. Could
>>> anybody help me? Thanks!
>>> By the way, I'm using vim 7.2 in Ubuntu 8.10, and the filetype.vim is:
>>>    if exists("did_load_filetypes")
>>>      finish
>>>    endif
>>>    augroup filetypedetect
>>>      au! BufRead,BufNewFile *.nc   setfiletype nesc
>>>    augroup END

> I didn't set any 'runtimepath' or 'rtp' option. And it does get
> hightlighted when opening other type files.

Please bottom-post, DragonKeeper, particularly if somebody already has,
or things get very confusing (posting guidelines are here:
http://groups.google.com/group/vim_use/web/vim-information
).

It is correct that you probably don't want the bang (!) on your
autocommand, but I doubt that will cause the problem.

You can check both autocommand events have been registered in Vim with

:au * *.nc

Assuming this shows two entries as expected, each saying setfiletype
nesc, I suspect the problem is not the autocommand but something in the
highlighting script. Could you share that (presumably nesc.vim)?

Another thing you can do to see what's going on is do

:set verbose=2 " or 10 or 15 for more details
:e whatever.nc
:set verbose=0

and see if that helps track things down.

Ben.




--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to