I am trying to map the NERDCommenterToggle command from the nerdcommenter plugin. I want to use "Ctrl+/" for this:

vmap <C-/> <plug>NERDCommenterToggle
nmap <C-/> <plug>NERDCommenterToggle

This won't work, I guess there should be some other name to map the slash key... I've already tried to find some info with :help, but I couldn't find anything.

  • 1
    Mapping / is possible (although not really recommended) but mapping <c-/> is probably not possible in terminal version of vim (unlike the gui one). This is a common problem of key codes (I tried to list some in this post) so it is very likely that you can only have this mapping working in GUI version of Vim (or neovim).
    – statox
    Jul 7, 2020 at 12:05
  • I am currently using neovim, how can it be done here?
    – rsaavedra
    Jul 7, 2020 at 12:09
  • In this regard the behavior is the same between vim and neovim.
    – statox
    Jul 7, 2020 at 12:11
  • 2
    It depends on the gui. It should be possible in gvim and xterm with modifyOtherKeys. Don't think Neovim supports this Jul 7, 2020 at 12:26
  • 1
    See vi.stackexchange.com/questions/26611/… Use <C-_> and it'll probably work
    – echo
    Jan 13, 2022 at 2:11


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.