Open dontlaugh opened 2 months ago
It would definitely be helpful to have the right-hand-side of the mapping included in the debug output, even if only just for mappings that do not include a docstring (which is most of them).
It only seems to show mappings that have been modified from the defaults
Technically, that's what a mapping is: a modification from the defaults. h
isn't mapped to the "move left" command, it is the "move left" command.
On one hand, it might be nice to have better visibility on the current state of the system; on the other hand, Kakoune tries pretty hard to discourage people from building abstractions - all the mappings in your configuration should be ones you put there yourself, not introduced by a plugin.
h isn't mapped to the "move left" command, it is the "move left" command.
Indeed, this is what I was trying to express. It's one of the more mind-bending strokes of genius of this editor.
Technically, that's what a mapping is: a modification from the defaults.
True. And :debug mappings
is already useful enough to show what's been modified. There should be a way to do that, come to think of it.
So maybe showing all the bindings might be best accomplished as an additional debug command called :debug all-keys
or similar.
The display of the right hand side of the mapping is another little enhancement that would apply in either case.
Maybe the best output would be to dump the mappings as valid kakscript? Just a thought.
for learning default mappings I used this command though it leaves some things to be desired (only works for normal mode).
I imagine it would be nice if there was a mechanical way to find out the meaning of a single key (whether mapped or not), something like Emacs' C-h k
but it's not clear how it should work. I don't think :debug mappings
is necessarily something for everyday use.
I agree the rhs should probably be included, should be easy to do
I agree the rhs should probably be included, should be easy to do
If that's easy to do, that would probably be the highest impact change mentioned, even if the other things can't be done right now (output unchanged defaults, add docstrings to everything).
I imagine it would be nice if there was a mechanical way to find out the meaning of a single key (whether mapped or not), something like Emacs' C-h k
That would be great! It also sounds like something that could be made difficult due to implementation details I don't really understand.
Since that's a really specific change, I will open a separate issue for just adding rhs to :debug mappings
. This issue can remain open and we can keep brainstorming on improvements to interactive feedback on current key mappings. #5152
Feature
Information about current key mappings is available from
:debug mappings
. See #3383However, I think we should work towards printing some more info here. Ideally I'd like to see
Note: or maybe even a reconstruction of Kakscript that creates the mapping...
Here is the output of
:debug mappings
from a recent session. I am running master 8870c7e1Click here for output
``` *** This is the debug buffer, where debug info will be written *** Mappings: * normalIn my opinion, there are some issues with the current output:
Number 1 is an issue of discoverability. Kakoune's interactive documentation is very good, but it is also quite expansive.
:doc keys
is 700 lines of asciidoc, and that's not the only place keystrokes are defined. I think printing all the default bindings as well as whatever is currently dynamically loaded from kakrc/plugins would be really helpful.As for number 2, I understand why it happens. Here's my remapped movement (I use Colemak-DH layout):
I do not provide a
-docstring
. But what I have is a reasonable configuration, I think, because what's interesting about Kakoune's command language is thath
literally means "move left". It seems like there is enough information at runtime to recover the original docstring, or perhaps for this class of commands the docstring could be preserved somehow, since mapping a key toh
will always move left?For number 3, here's an example from my config that gets dynamically loaded for Go code
... and
:debug mappings
prints thisWhat if instead it printed something like this?