This is impossible as Vim doesn't "see" <C-S-h>
.
Try the following:
Open Vim and enter insert mode. Noch press <C-v>
followed by <C-h>
. Vim
will insert ^H
(highlighted in light blue by default). So Vim got <C-h>
.
Now press <C-v>
followed by <C-S-h>
and Vim will again insert ^H
.
So from Vims point of view, <C-h>
and <C-S-h>
are identical.
The reason is Vims origin as a terminal based program. Those terminals only
supports "simple" control-character combinations.
You can use the test described above ( <C-v>
...) with any key combination
you would like to map.
PS: On my setup with Linux and GNOME-Terminal, Vim doesn't see <C-S-h>
at
all, as the key combination is used by GNOME-Terminal.
Updated after the comments from Christian Brabandt and user938271:
Your mapping works with GVim (tested with 8.2.869).
Depending on the terminal emulator it might be possible for Vim to get the
<C-S-h>
.
The XTerm terminal emulator supports a option called modifyOtherKeys
. With
it the terminal supports additional key combos like <C-S-h>
.
When XTerm is correctly configured, the mapping you describe work as expected.
Tested with Vim 8.2.869 and xterm 351.
Read about it in :h modifyOtherKeys
.
Notes:
- I don't know which other terminal emulators support
modifyOtherKeys
.
modifyOtherKeys
is not supported by GNOME-Terminal (see this bug )
- First mention of
modifyOtherKeys
in a Vim commit was version 8.1.2134 (Oct 2019)
Conclusion: Your mapping will work with the right terminal emulator and
configuration and a up-to-date Vim, but I would not rely on this, as it is not
widely portable.