Add option to disable native paste markdown link over selected text (replace text instead), and separate commands to add link or replace (with cutomizable shortcut)

Use case or problem

I often copy-paste URLs to replace existing text that I’ve selected, and I don’t want to add a hyperlink using the selected text as label. Sometimes I want to replace an outdated URL with another one.

Since Obsidian v1.11 (changelog):

When text is selected, pasting a URL into the editor will convert the selection into a Markdown link using the URL (e.g. [selected text](pasted URL)).

This is a useful feature formerly done using Paste Link plugin, however hard-binding it to Paste makes it less flexible than Paste Link’s separate command “Paste Link: Paste Markdown link” (note: Paste Link repository is 404 and plugin has been removed from community plugins list without explanation).

This causes me to add hyperlinks instead of replacing the selected text. When replacing a bad URL this is particular visible:

Initial text
https://example.com/
=> copy fixed URL, select old URL and Ctrl+V to paste
[https://example.com/](https://fixed.example.com/)
=> oops, but whole text is still selected, try to fit it by using Ctrl+V to paste again
[[https://example.com/](https://fixed.example.com/)](https://fixed.example.com/)
=> give up and Delete text then paste
https://fixed.example.com/
=> OK

The workaround is to always make sure to delete the selected text, then paste, but I’d rather have one command (this way, it’s 1 shortcut press when I remember to do it, and 2 if I forget since the whole hyperlink Markdown will still be selected so I have an extra chance to replace it - currently it’s 2 presses when done right, and 3 presses if you mess up once). It also requires me to remember to adapt my behavior whether I have a URL in clipboard or not.

Unfortunately, Paste is a native command, hard-bounded to Ctrl+V. It doesn’t even appear in the Hotkeys list. It is overridable though as I can bind a plugin action to Ctrl+V to replace that behavior (although I have yet to find a plugin that does this. Paste Reformatter stopped working altogether recently so I couldn’t even test it).

Proposed solution

I need to be able to paste a URL while replacing the selected text, but the existing behavior should also be preserved for when it’s useful.

The solution could be split in the following tasks:

  1. Obsidian settings: add a toggle to enable/disable Paste hyperlink onto selected text (on native paste Ctrl+V)
  2. Add separate command “Paste hyperlink onto selected text” (with customizable shortcut e.g. Ctrl+K)
  3. Add separate command “Paste replacing selection” (with customizable shortcut e.g. Ctrl+K)
  4. Bonus: add native Paste (as well as other native commands like Cut (Ctrl+X), Copy (Ctrl+C) and Paste without formatting (Ctrl+Shift+V), for consistency) to the list of customizable Hotkeys. This way users can keep it aside while mapping the more specificing paste command to the shortcut variant they like.

At least 1 or 3 should be implemented to allow Paste replacing selection. Ideally all of them for more control.

Paste Link plugin being dead, I can’t count on its “Paste Link: Paste Markdown link” action so 2 would be welcome if I don’t want to rely on the toggle in 1 too much.

Current workaround (optional)

Delete selection, then paste

Related feature requests (optional)

Interestingly, most people were looking for the opposite so far, and it’s probably why it was made the default in v1.11.