Unclear how to get list of commands and their currently assigned hotkeys

I desperately need a table of commands together with their currently assigned hotkeys.

My naive approach was to iterate over app.commands.commands, get their hotkeys and modifiers and throw the result at Dataview (see DataviewJS Snippet Showcase - #13 by Moonbase59).

Unfortunately, this list only seems to show the default key assignments, not the changes I make using the hotkey manager.

Is there an easy way to get at the currently assigned hotkeys and their modifiers or do I really have to traverse app.hotkeyManager.customKeys in addition to above, to get the current state of things?

1 Like

Did you look at Settings>HotKeys

Sure. But that can’t be sorted by keys, and I need it in a sortable list.

Using the console (ctrl+shift+i), one can inspect two arrays

  1. key assignments
app.hotkeyManager.bakedHotKeys

  1. command ids
app.hotkeyManager.bakedIds

Perhaps that helps

1 Like

Yep, I saw these, but couldn’t believe I had to get everything (in different ways) from several places. Can’t believe Obsidian hasn’t a complete commands list with the changes “baked in” :wink:

Solved in DataviewJS Snippet Showcase - #37 by Moonbase59

2 Likes