Hi Ben, I use ":au * *.nc" to check autocommand events, but there is nothing. After that, I set the verbose and the following is the output:
"PlatformSerialC.nc" 21L, 417C Reading viminfo file "/home/xin/.viminfo" marks Searching for "scripts.vim" in "/home/xin/.vim,/var/lib/vim/addons,/ usr/share/vi m/vimfiles,/usr/share/vim/vim71,/usr/share/vim/vimfiles/after,/var/lib/ vim/addon s/after,/home/xin/.vim/after" Searching for "/home/xin/.vim/scripts.vim" Searching for "/var/lib/vim/addons/scripts.vim" Searching for "/usr/share/vim/vimfiles/scripts.vim" Searching for "/usr/share/vim/vim71/scripts.vim" line 0: sourcing "/usr/share/vim/vim71/scripts.vim" finished sourcing /usr/share/vim/vim71/scripts.vim continuing in BufRead Auto commands for "*" Searching for "/usr/share/vim/vimfiles/after/scripts.vim" Searching for "/var/lib/vim/addons/after/scripts.vim" Searching for "/home/xin/.vim/after/scripts.vim" I think "continuing in BufRead Auto commands for "*"" is not right. BTW, I didn't write the nesc.vim by myself. the script coming with TinyOS is: 1 " Install this file to ~/.vim/syntax/nesc.vim. 2 3 runtime! syntax/c.vim 4 let b:current_syntax = "nesc" 5 6 syn keyword cStatement abstract as async atomic call command 7 syn keyword cStatement components configuration event generic 8 syn keyword cStatement implementation includes interface module 9 syn keyword cStatement new norace post provides signal task unique 10 syn keyword cStatement uniqueCount uses 11 12 syn keyword cType result_t error_t 13 14 syn keyword cConstant SUCCESS FAIL TRUE FALSE I installed it in ~/.vim/plugin/nesc.vim. On Dec 11, 4:54 pm, Ben Schmidt <[email protected]> wrote: > >>> 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 setfiletypenesc > >>> 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 setfiletypenesc, I > suspect the problem is not the autocommand but something in the > highlighting script. Could you share that (presumablynesc.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 -~----------~----~----~----~------~----~------~--~---
