1

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.

andrey
  • 1,515
  • 5
  • 23
  • 39
  • 1
    Did you change your leader? (`:echo mapleader`) Does anything else change the binding? (`:map c$`) Do you delay between keypresses? (`:set timeoutlen?`) – Amadan Aug 23 '16 at 02:35
  • `:echo mapleader` doesn't output anything; I haven't added anything related to nerdcommenter to my `.vimrc`. `:map c$` outputs `n c$ NERDCommenterToEOL`; delay between keypresses is <1000ms of `timeoutlen`. – andrey Aug 23 '16 at 02:43
  • 1
    All seems to be in order then; in particular, NERDCommenter did load (otherwise `c$` would not have a mapping). I don't use NERDCommenter so I can't tell you why it's not doing what you expect it to do :( – Amadan Aug 23 '16 at 03:29
  • NERDCommenter's issue tracker is [that way](https://github.com/scrooloose/nerdcommenter/issues). – romainl Aug 23 '16 at 06:11

1 Answers1

1

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.
Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324