preservim / nerdcommenter

Vim plugin for intensely nerdy commenting powers
Creative Commons Zero v1.0 Universal
4.99k stars 448 forks source link

Why is commentstring being ignored? #114

Open wting opened 11 years ago

wting commented 11 years ago

From readme.md:

[..] the script makes use of |'commentstring'| where possible (which is usually set in a filetype plugin).

I have filetype plugin on in my .vimrc.

For example, in a C file running the following command:

:verbose set commentstring?
commentstring=//%s
    Last set from ~/.vim/ftplugin/c.vim

Or Haskell:

:verbose set commentstring?
commentstring=-- %s
    Last set from /usr/share/vim/vim73/ftplugin/haskell.vim

However, when using nerdcommenter (most commonly with <leader>c) it seems to prefer it's own hardcoded commentstrings.

xiechao06 commented 9 years ago

only before filetype plugin activated, commentstring will work. use autocmd please. or use g:NERDCustomDelimiters (which is recommended in help docs)