Adding a New File to NERD Commenter

I am using NERD Commenter . I want to add a new file type to it. In the latest version, file type definitions begin on line 69. I want to add separators for .pde (Arduino). Since the .pde files follow the same style as C ++, I just copy the C ++ line (line 115) and change the extension. It looks like this:

.... .... \ 'pde': { 'left': '//', 'leftAlt': '/*', 'rightAlt': '*/' }, .... .... 

And that seems right. However, I cannot get it to work when I open the .pde file. Instead of using '//', it uses '#'. Did I miss something?

Thanks!

UPDATE: It seems I am doing this, writing. Look at the commit when they added a comment to support gsp . They just do the same as me. Mmm ...

+4
source share
1 answer

Probably because filetype pde does not exist in thetyty.vim file.

Basically, you need to create your own typety.vim file in ~ / .vim / (which will be received before the systemtype.vim file) or add to your .vimrc:
" Arduino files
au BufNewFile,BufRead *.pde setf pde

(On the other hand, gsp already exists in filetype.vim by default, 763
" GNU Server Pages
au BufNewFile,BufRead *.gsp setf gsp
" GNU Server Pages
au BufNewFile,BufRead *.gsp setf gsp
)

See :help new-filetype for more information on how to implement a new file type.

+2
source

All Articles