mawww / kakoune

mawww's experiment for a better code editor
http://kakoune.org
The Unlicense
9.7k stars 705 forks source link

Adding keybinding for `<c-/>` does not work #5165

Open kamurani opened 2 months ago

kamurani commented 2 months ago

Question

Hello,

I was trying to add a custom keybinding (to toggle comment blocks) using Ctrl+/. However, with this in my kakrc:

map global normal <c-/> ":comment-line<ret>"

Pressing Ctrl+/ causes the terminal bell error sound, and acts as if I have only pressed / (with the search: prompt appearing).

Is this just a bug, or is / a reserved character in kakoune and can't be used in bindings?

Thanks in advance!

krobelus commented 2 months ago

Works here. Which terminal is this? Mapping <c-/> should in theory work on all terminals, although it might conflict with <c-_> on some

krobelus commented 2 months ago

Ok on Konsole mapping <c-/> does not work. As a workaround one can map <c-_>. Perhaps different from the bug you're seeing but the workaround might work in both cases. I think the phenomenon here is that \x2F in keyboard input is canonicalized as <c-_>, sidelining the <c-/> alias.