List current key map

With key mappings being scattered through several kak files, and sometimes conditionally activated (such as plugin configs), it’d be helpful to get a list of all key map definitions in effect for the current session. This is mainly useful for remembering all the mappings I’ve made, so that I can see what keys are available for making new maps.

Though, if I need help remembering, maybe that’s a sign I have too many mappings.

My first idea is just a simple grep of the config dir:

!grep -rnw $kak_config -e 'map'

So that works well enough for most things, but it doesn’t show which are active, and one could override another.

You may be be interested in :debug mappings :slight_smile:

1 Like

Yes, exactly what I was looking for. Thanks!

I reckon many useful stuffs are hidden in the arcane output of the :debug command.

Most should be graduated in a something like :list command which will feel more “official” to consume by scripts.

For examples, the current :debug buffers command could be turned into :list buffers which would populate a *buffers* buffer with predictable and documented fields (name, filename, flags…). This output would be more detailed than %val{buflist} and offers easily parseable data not mixed with errors or other debug lines.

Same for :list faces populating a *faces* buffer, :list registers filling a *registers* buffer etc…

with respective colors!

Emacs has this nice feature: