Hotkeys for Specific Patterns #5
Replies: 1 comment 6 replies
-
Thank you for writing, @FelipeRearden! This is something that I'd been thinking about, as well. I hadn't targeted it yet because to my knowledge, there's no way to un-register a command in Obsidian after registering it, short of reloading Obsidian. Thus, for commands with names that the user might change at any given time, I wanted to think more about how to apply this. I've come up with what I think is a flexible way that would allow exposing individual Patterns as commands, as well as grouping Patterns together into new command menus. The draft is in #11; are you familiar with how to test that? If so, would you be willing to give it a try? (If not, no worries, of course!) In the Settings tab, I've added a new "Commands" section. Each command has a name, and a search string for Pattern names. If a command matches just one Pattern, it will run that Pattern. If it matches multiple Patterns, it will pop up a searchable menu asking which Pattern to run. Each command can be set to run on whole lines, the whole document, and/or just the selection. (So the setting in the screenshot, which is set to both Lines and Document, would create two new commands in Obsidian: This allows setting up hotkeys for individual Patterns for different scopes (tying into your suggestion in #8), as well as for collections of Patterns that share a common theme or context. Does that make good sense, as I'm putting it? |
Beta Was this translation helpful? Give feedback.
-
More info about me here
Hello @Publicus !!!
My workflow in Obsidian is 99% with keyboard and hotkeys.
In my opinion, would be amazing to be able to create a specific hotkey to each one of the Patterns in Command Palette
To make this possible, the pattern option prompt
window B
should be appearafter
the user select the pattern optionwindow A
.From the example in your git:
window B
Command Palette —>window A
User selected —> Apply Pattern: “Set Open task as Complete”window B
should appear beforewindow A
in my opinion. This way I can apply the hotkey to the specific pattern them decide about the range (whole line
orto selection
)Let me know if you need more information.
Thanks and have a great day!
Beta Was this translation helpful? Give feedback.
All reactions