The problem is solved. Thank you, Ben! I learned a lot.

On Dec 12, 7:37 pm, Ben Schmidt <[email protected]> wrote:
> Hi, DragonKeeper,
>
> Please write your replies under a short-relevant quote like I am doing.
> This is called 'bottom-posting' and is the convention on this mailing
> list.
>
> > I use ":au * *.nc" to check autocommand events, but there is nothing.
>
> OK. So something has gone wrong with registering the autocommand.
>
> The snippet you had for 'filetype.vim' should be in ~/.vim/filetype.vim:
>
>      if exists("did_load_filetypes")
>        finish
>      endif
>      augroup filetypedetect
>        au! BufRead,BufNewFile *.nc   setfiletypenesc
>      augroup END
>
> You also need to have
>
>      :filetype on
>      :syntax enable
>
> or something similar to that in your ~/.vimrc.
>
> Make sure you have both those things, and then check that if you do
>
>      :au * *.nc
>
> then indeed you do get two commands listed. Until that is sorted out, it
> won't work.
>
> > After that, I set the verbose and the following is the output:
>
> Your results are consistent with the autocommand not being registered.
>
> > BTW, I didn't write thenesc.vim by myself. the script coming with
> > TinyOS is:
>
> >   1 " Install this file to ~/.vim/syntax/nesc.vim.
>
> > I installed it in ~/.vim/plugin/nesc.vim.
>
> You need to install it in ~/.vim/syntax/nesc.vim like it says. Note
> 'syntax' not 'plugin'. You may need to create that directory. That
> explains why it works when Vim starts up (which is when it reads
> plugins) but not for other files (when it detects filetypes and loads
> syntax).
>
> Ben.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to