Duplicate Line(s) Keyboard Shortcut

I humbly submit cmd + shift + D as a keyboard shortcut to duplicate the current line, or the currently selected lines. This is a code editor shortcut that comes in handy for me when taking notes.

Any other variant would work. I’d prefer cmd + D, but as I’ve discovered that’s a command to delete the current line.

Thanks to the Obsidian team!

9 Likes

If you have a macro software, you could just do this with a macro. E.g., with Keyboard Maestro on the Mac:

That’s great until I need to use Obsidian on another computer. It would be nice to know that, out of the box, wherever I want to use it, Obsidian has a keybinding for duplicating lines.

2 Likes

There’s already Vim keybinding built in, which would allow me to duplicate lines fairly easily. Being able to quickly toggle between using Vim and regular key bindings would be nice too.

1 Like

@lizardmenfromspace Should probably add to your meta list!

Not urgent, but I think Sublime Text has had a great line duplication feature (CTRL/Command + Shift + D) and duplicates by line or by selection. I’m sure its not the only editor to have the feature, but I hadn’t explored other editors as deeply.

This is actually the multi-selection that Sublime is renowned for. Yes, it’d be great to have even some of those

Most of the other major text editors and IDEs have this feature. I hope it becomes part of the core keybindings, not just in VIM, which not everyone uses.

1 Like

The Hotkeys++ plugin now has this shortcut.

2 Likes