Vim NERD Commenter \c deletes the line instead of toggling comments

1.4k views Asked by At

The following works fine for me, it will comment out the current line:

<Leader>cc

but according to the docs (https://github.com/scrooloose/nerdcommenter#usage) if I want to toggle comments I do:

<Leader>c

which deletes the current line for me.

Am I missing something?

2

There are 2 answers

1
jonafato On BEST ANSWER

This command is actually <Leader>c<space>, not just <Leader>c (see this issue; this is not properly displayed in the readme).

0
wcc526 On

mac

map <C-_> <plug>NERDCommenterToggle<CR>
imap <C-_> <Esc><plug>NERDCommenterToggle<CR>i

windows

" Alt-/ to toggle comments
  map <A-/> <plug>NERDCommenterToggle<CR>
  imap <A-/> <Esc><plug>NERDCommenterToggle<CR>i