Using NERDCommenter

1.2k Views Asked by At

The tutorial gives this example:

<leader>c$ |NERDComEOLComment|
Comments the current line from the cursor to the end of line. 

But pressing \c$ or ,c$ in vim copies the current line and switched to insert mode.

I've installed the plugin via pathogen and :help nerdcommenter does work, but there's no mention of nerdcommenter in the output of :scripts, don't know if that means the plugin hasn't been successfully installed.

1

There are 1 best solutions below

1
Ingo Karkat On

This looks fine. Here are some troubleshooting tips:

  1. Check the :scriptnames output for .../plugin/NERD_commenter.vim; it needs to be there.
  2. Check :echo loaded_nerd_comments
  3. Check :echo g:NERDCreateDefaultMappings
  4. Check :nmap <Leader>c
  5. Do other mappings work? Define :nmap <Leader>x :echomsg "Works"<CR> and press \x.
  6. If mappings don't work, you may have accidentally :set paste. Undo with :set nopaste.