Duplicate line command

Please could you add support to duplicate a line or selection with ctrl + d or ctrl + D
This would be excellent while creating tables or lists.

This feature can be found in Atom, VS Code and other text editors.

1 Like

I would also love to see this feature added. Currently it is the main reason I open to edit in VS Code, if it was provided in Joplin it would definitely be more streamlined.

I think this can be easily implemented as a plugin if I am not wrong.

I've added this and the mark shorcut/toolbar button/menu item to my branch. Maybe I will create a plugin called KC's tweaks or something. :wink:

That would be fantastic, thanks so much for responding so quickly.

I'm currently a bit busy, but I hope I can get something up and running within the next week.

If you create such a plugin, would you mind adding a toobar button for strikethrough as well ? (Mark text and strikethrough are two markdown codes I use a lot)
Thanks !

A duplicate line feature is a core feature of most editors.

Does it make sense for this to be a core feature of Joplin?

I think it would. I can't remeber why it wasn't added. It's just one line of code (2 actually).

1 Like

Core features currently include Delete Line, Swap Line Up/Down, and add Hyperlink all with keyboard shortcuts. I don't think Duplicate Line would be too advanced to add.

@laurent is it ok to add this to core? I remember it was available in the old editor but got removed when switching to CodeMirror.

I can have a PR ready in no time.

1 Like

I think we discussed this and other shortcuts at some point and they weren't added for some reason. Perhaps @CalebJohn would know?

I think the reason was to wait until people want them back. Basically to start with the minimum possible and then to extend, if necessary. But maybe I remember incorrectly.
Let's wait for Caleb's input. But I don't think there was a technical reason not to add them.

1 Like

That's how i remember it as well. Adding this to core makes sense as it seems like there is support for it.

1 Like

Right, it's true we discussed what shortcut should or should not be included and I guess this one didn't make the cut. So yes @tessus feel free to add it to the core then.

1 Like

Done.

While we're at it... haha. No, I'm not going to say anything.

6 Likes

I love open source. Thanks for adding the feature!

I need to pull down the source and see if I can help with something.

1 Like