Homepage    |    GitHub    |    API    |    FAQ

Command+Backspace to delete line MacOS

On every MacOS app I use besides Joplin, the native keyboard shortcut for delete line is Command+Backspace. I know you can currently do this with Command+d but I think it would be good for it to match the OS convention.

I have no Mac, but I think you can rebind the shortcout in Joplin in Options > Keyboard Shortcut

Indeed it looks like it's in there, if you search for "delete".

They are similar but not identical. In all other MacOS apps, Command+Backspace deletes the entire line up to the point of the cursor.

The GIFs below demonstrate the difference, the top within Joplin, and the bottom within the Firefox address bar. The bottom one is similar in almost all MacOS apps.

joplin delete line
firefox delete line

This would probably require an additional CodeMirror shortcut. I'd have to check if one is already available. Caleb has worked a lot with CodeMirror code and I'm sure he knows what is available.
I can also have a look at the CM documentation.

So, just to be clear, you do not want to delete the line with Cmd+Backspace as said in the original post and the topic description.
You want to delete the text up to the cursor, correct?

That's correct, it was poorly described in my original post. I'm looking to delete all text up to the cursor with that shortcut, which imo should be a native shortcut on MacOS.

Yep, there's a CM command that is not set in Joplin: delWrappedLineLeft

This would have to be set in the Joplin code. I can add this, if Laurent is ok with it.

1 Like

@laurent what do you think? Shall I add this shortcut?

Yes that would work, feel free to create a PR for it.

Will do. Shouldn't take very long.

Ha, I even added it to the keymapservice that people could change it. Then I noticed that on Windows/Linux Ctrl+Backspace is used for something else: delGroupBefore.

So. Now I will only add it to the CM shortcuts and only for macOS, since apparently this is not a typical Windows/Linux shortcut anyway. TBH, I have never even used this on macOS.

Thanks @tessus ! I use this shortcut a ton in other apps so it is much appreciated!