14

I'm wondering if it is possible to map control + forward-slash in vim. The mapping would be for normal mode if that makes a difference.

I have tried <c-/> but that didn't work.

I also tried looking at the :help keycodes docs but was unable to understand if it was possible.

RobStallion
  • 319
  • 2
  • 10

1 Answers1

25

Use <C-_>. For example, to map Ctrl/ to :help,

noremap <C-_> :help<CR>

From :help :map-special-keys,

There are three ways to map a special key:

  1. The Vi-compatible method: Map the key code. Often this is a sequence that starts with <Esc>. To enter a mapping like this you type ":map " and then you have to type CTRL-V before hitting the function key. (...)

If I try :map CtrlVCtrl/, I get the ^_ symbol, indicating that the corresponding map is <C-_>. If you get some other sequence, map that instead.

Quasímodo
  • 2,466
  • 9
  • 22