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.
Thoughts?
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…
My preference is that lots of plugins can define their own commands, modes, whatever, but all keymaps are consolidated to the right filetypes, or kakrc for global ones.
So first should mention that I have no real experience with c++ so this is probably a thrown together mess but this is a patch to commands.cc that adds showing the current mapping to :debug mappings:
I install it using the command: patch src/commands.cc < ~/commands.cc.diff