kakoune icon indicating copy to clipboard operation
kakoune copied to clipboard

improve keys mapping documentation

Open naringas opened this issue 3 years ago • 5 comments

Update mapping.asciidoc

Add explanation about mapping some characters lifted from https://github.com/mawww/kakoune/issues/2553

naringas avatar Mar 12 '21 20:03 naringas

Actually, all those keys can be mapped without <c-v> now. However, it may be worth adding a section describing some of the redundancies commonly encountered via the terminal interface:

Mappable key Aliases
<c-space> <c-2>, <c-@>, <c-`>
<esc> <c-[>, <c-3>, <c-{>
<c-\> <c-4>, `<c-
<c-]> <c-5>, <c-}>
<c-^> <c-6>, <c-s-6>, <c-~>
<c-_> <c-7>, <c-/>
<backspace> <c-8>, on some terminals <c-h>
<tab> <c-i>
<ret> <c-j>, <c-m>

Screwtapello avatar Mar 13 '21 04:03 Screwtapello

Hi, I updated the docs based on https://github.com/mawww/kakoune/pull/4101#issuecomment-797861857

naringas avatar Mar 15 '21 22:03 naringas

Hello,

It looks to me like those are artifacts of how some terminals encode keys, and we are getting close to having that fixed thanks to CSI u and the recent push in some terminals to add a enable/disable escape sequence for it.

I am not very keen on adding this inside the documentation as it relates more to terminal emulators than to Kakoune itself.

mawww avatar Mar 20 '21 23:03 mawww

While these keyboard encodings are out of Kakoune's control and therefore not it's responsibility, it's more likely that a user will hit a problem with Kakoune than with other tools because Kakoune's key-name syntax is so flexible. And it's not immediately obvious where to look for such documentation: the fact that <c-3> is associated with the byte \x1b (ESC) is implemented in the X server, so it works in a terminal like st even though that mapping does not appear in st's source code, never mind its documentation.

As terminals that support CSI u become more widespread, this behaviour will become more surprising to the people who bump into it, so if the documentation acknowledges that these encodings exist in old/weird terminals, the resulting user happiness will outweigh the documentation maintenance cost.

Also, it gives us a place to say "if these restrictions annoy you, go pester your terminal emulator to support CSI u, instead of filing issues against Kakoune".

Screwtapello avatar Mar 21 '21 02:03 Screwtapello

While these keyboard encodings are out of Kakoune's control and therefore not it's responsibility, it's more likely that a user will hit a problem with Kakoune than with other tools because Kakoune's key-name syntax is so flexible

This has been the case in my experience, I had a weird issue where alt-; wouldn't work unless I chaned my keyboard layout, but then it would break again (it would work for a few minutes after resetting it). I wound up changing to a completely different layout.

Also, it gives us a place to say "if these restrictions annoy you, go pester your terminal emulator to support CSI u, instead of filing issues against Kakoune".

I think it would also be more helpful to also say a few words about terminal emulators and the way keyboards work within them and within Xorg. For example, I had never heard of CSI u (but I have been reading up about terminfo)

naringas avatar Mar 22 '21 15:03 naringas