nerdcommenter icon indicating copy to clipboard operation
nerdcommenter copied to clipboard

Why is commentstring being ignored?

Open wting opened this issue 11 years ago • 1 comments

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.

wting avatar Apr 29 '13 18:04 wting

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

xiechao06 avatar Feb 17 '15 04:02 xiechao06