Where are my hotkeys stored?

Things I have tried

I’m comparing the “hotkeys” section of the Obsidian preferences to the json file at .obsidian/hotkeys.json
The two disagree. I expected them to be mirrors of each other, or at least consistent.

What I’m trying to do

Sometimes I want to find out what a hotkey is bound to and Obsidian does not make that possible without scrolling the whole list, which is tedious and error-prone and not automatable. For example, it’s very difficult to find what e.g. opt-ctl-B is bound to using the GUI. So instead, I tried grepping through .obsidian/hotkeys.json.
However, this does not have an accurate view compared to the GUI.
Here is a screenshot of an example. My hotkeys.json file seems to think that mod-shift-P means “templater-obsidian:Templates/Personal Meeting Template.md”, but the GUI disagrees.

So I must be misunderstanding something basic. Is hotkeys.json supposed to be what it sounds like?

Templater has some registered app commands, but it looks like template hotkeys are stored in the plugin settings. No idea what file that is:

1 Like

Thank you.
Interesting, maybe all this is just because of Templater, thanks. I’ll pursue that in the Templater issues discussion area on github. It would not be good news for me if I have to look in multiple spots for hotkeys… thanks for the feedback.

I can’t fully answer where they are stored, but in this post: DataviewJS Snippet Showcase - #269 by holroy, I’ve modified a previous script by moonbase59, which lists all the hotkeys, and is searchable.

It does include Templater hotkeys, as well as default hotkeys. So it seems to be complete.

Hope this helps.

2 Likes

Thank you yes, I saw that in response to the other question I asked on this subject.

Could you please explain what that list doesn’t provide, or is wrong, regarding to which hotkeys are actually used?

Or what it is you’re trying to do, which the list doesn’t provide? Why do you want the actual location of these defintions? And/ or how do the definitions mismatch?

I have a solution as given by you yourself here: DataviewJS Snippet Showcase - #269 by holroy There is nothing more to say on this subject other than a very small typo I found in your sorting code in the first block (.id → .name). Thanks for the incredibly useful help!

This doesn’t answer your question, but perhaps could solve your problem. Have you tried the Keyboard Analyzer Plugin?

Nice and easily searchable. Worst case maybe the code would help you. Here’s the github pointer.

2 Likes

I wish I could credit for two solutions. I really enjoyed learning more dataviewjs, and also that plugin is incredibly useful.