Klojer / obsidian-emacs-text-editor

GNU General Public License v3.0
21 stars 4 forks source link

Holding down a shortcut key is the same as pressing it once #2

Closed wengyk closed 8 months ago

wengyk commented 1 year ago

Holding down a shortcut key is the same as pressing it once, not the same as pressing the shortcut key continuously. In Emacs, holding down a shortcut key is equivalent to pressing the shortcut key continuously.

Klojer commented 12 months ago

@wengyk, hi. Thank you for feedback.

I've started branch https://github.com/Klojer/obsidian-emacs-text-editor/tree/issue2/holding_shortcuts. It seems to possible, but will conflict with regular commands shortcuts (Key down event not fired if there is a shortcut binding for a command from palette). I need to figure out how to handle this conflict.

wengyk commented 11 months ago

Great, looking forward to this very much!

Klojer commented 8 months ago

I'm afraid, I still have no adequate solution for the issue. Using Key down events will conflict with the built-in keybinding mechanism and leads to increased CPU usage. I'll close the issue until I can find a good enough solution.

@wengyk, you can try to use code mirror extension plugin.

akaihola commented 2 months ago

code mirror extension plugin

FYI, obsidian-emacs doesn't seem to work for me. It does disable some of the default keybindings (like Shift-up/down), but none of the Emacs keybindings do anything. I extracted v1.0.0.tar.gz into my vault's .obsidian/plugins/ directory and enabled Emacs Keymap / Version 1.0.0 / By Dale Sedivec / Emacs keymap for CodeMirror 6 in Obsidian. in the settings.

There's also an ongoing discussion Emacs bindings in the editor about this on the Obsidian forum.

Obsidian Emacs Bindings seems like the most promising plugin for this purpose.