Is it possible to bind <C-->
(or <C-dash>
or <C-minus>
, I actually do not know) in vim to something, like <C-W><C-Q>
?
What does it mean <C-->
in the default binding?
Perhaps you could make that binding work in gvim, but not in vim running in a terminal, because you are unlikely to find a keyboard configuration which sends a different sequence of characters for control/Minus. As a rule, the control modifier affects only a few non-alphabetic characters.
Here is a screenshot from vttest
, which happens to illustrate the usual set of control keys:
You can set the command by typing control-v
, then the key combo you want.
So for "control" + "minus", enter the following on a new line in your ~/.vimrc
:
nnoremap *type on your keyboard*<ctrl-v><ctrl-minus>*end type* :MyCommand<cr>
Hopefully this makes sense!
*type on your keyboard*
really part of the command?
Sep 17, 2017 at 20:00
.vimrc
, and what you would type at your keyboard.
Sep 18, 2017 at 4:45
I'm using a UK keyboard where underscore is shift-minus, and I found I could map a key to <C-_>
(i.e. control-underscore) and it works with control-minus (though as @Thomas says above, not in a terminal window because that's predefined to zoom out)
I couldn't find that documented anywhere - it was just a hunch. I'm not sure what would happen on other keyboards.