I'm relying heavily on
Ctrl+D on macOS, because there's no key to delete the character right of the cursor. On a fullsize keyboard there's ususally a real delete key. (Apple calls the backspace key
I can also use
fn + delete to remove a character to the right of the cursor on a MacBook, but old habits die hard. (This works in every editor, SublimeText, on discourse, LibreOffice, ...)
Ctrl+D did work in Ace. Is there a reason why this doesn't work with CodeMirror?
No real reason, codemirror seems to go it's own route with default keybindings. As a project Joplin never really officially supported any keybindings so there was no way to gracefully migrate to a new editor.
As long as @laurent is okay with it, adding this shouldn't be a problem.
@CalebJohn, is there a list of keyboard shortcuts we support in CodeMirror somewhere? I think we should put this in a document somewhere so that we know what we're currently supporting and what perhaps we should add support for.
Ideally I think we should support only a very minimal set of keyboard shortcuts. Then instead of adding more, we could expose the CodeMirror API via commands and let people add their own custom shortcuts. For example, there could be a command "editorDeleteChar", which could be mapped to Ctrl+D.
Edit: In fact, we already have an "execCommand" function which works on both TinyMCE and CodeMirror and which already gives access to editor commands, so I guess we could leverage that with the command service.
No documentation yet, but the code has a simple list of supported commands here. And all available commands are exposed under
Would it be possible to connect the available codemirror commands to the KeyMapService? This way users always have an up to date list of available commands and users can map them in any way they want.
Yes it should be possible. I'm doing some refactoring and clean up while implementing the plugin service, and might connect the CodeMirror commands as part of this.
Let me know if you need my support in doing that, I'm happy to help.