Vim NerdCommenter: adding a new file type to vimrc

Is there a way to define a new file comment for NerdCommenter in .vimrc?

It already works, but it would be easier to back up the config if I can put it directly in .vimrc.

Thank.

+3
source share
2 answers

NERDCommenter is able to parse a parameter commentstring, so if you have only one possible comment marker, you can put the following in vimrc:

augroup SetCMS
    autocmd FileType ocaml let &l:commentstring='(*%s*)'
augroup END

(, /*%s*/ //%s ++). NERDCommenter, . .

+2

NERDCommenter, , , .vimrc:

let g:NERDCustomDelimiters = {
    \ 'someFiletypeOfYours': { 'left': '#'}
\ }

GitHub, .

+1

Source: https://habr.com/ru/post/1781074/


All Articles