Spacekeys: Execute Commands Based on Sequences of Key Presses

I recently migrated from Emacs Org-mode to Obsidian for all my note-taking needs. Overall it’s a much better experience, but one thing I miss is the hotkey system from the Spacemacs Emacs distribution, which makes (nearly) all functions easy to access without removing your hands from the keyboard. Spacekeys is an an attempt to replicate some of that functionality in Obsidian:

  • Commands are assigned to sequences of simple key presses, entered after activating a “leader” hotkey (e.g., Ctrl + M).
  • By default the key sequences are based off of simple mnemonics, for example il for insert link. Commands with similar functionality are grouped under the same prefix key(s).
  • Activating the leader opens a pop-up menu displaying valid choices for the next key in the sequence, and the corresponding command / group labels (similar to the “which-key” Emacs package).
  • The built-in key map already contains a large fraction of Obsidian commands, and can be customized further.

There are several other plugins which provide similar functionality, but none of them quite fulfilled my needs. This one is most similar to Key Sequence Shortcut, the main differences being that it’s easier to customize the key map (IMO) and commands with the same prefix are shown as groups in the pop-up menu.

This is my first plugin and I’d be interested to get people’s feedback or suggestions.

4 Likes

This looks interesting. Will it be available via Community Plugins?

I’ve submitted it, it seems like the turn around for approval takes a while.

1 Like

As a former org-mode in GNU Emacs user and person who wants hotkeys for everything, I love the return of a leader command. Did you experience any friction returning to this style of command execution in Obsidian or find moving from the default hotkey system to one like Spacemacs?

I’m still working on tweaking the experience. Unfortunately there’s still a lot missing, I managed to assign a majority of the available Obsidian commands to the default key map but that still doesn’t include a lot of things you can do in Spacemacs.

I’m also still figuring out how to get the space hotkey working in different contexts than Vim normal mode, it should be available in reading mode or when focused on the sidebars for example.

1 Like

hi , your plugin popped up in a google search it looks very promising , can you drop any updates on the progress of the plugin and any insight on making it as much future prof as possible as i do not wanna adapt to another awesome plugin and losing its access after some time. nice work bdw