obsidian-auto-link-title icon indicating copy to clipboard operation
obsidian-auto-link-title copied to clipboard

Disable auto-link on ctrl-shift-v

Open kmaustral opened this issue 3 years ago • 6 comments

Sometimes the titles are not meaningful, so it would be good to have a simple way of undoing or preventing auto-linking. This is usually possible with shift-paste. It would be great to have that for this plugin.

kmaustral avatar Jan 26 '22 01:01 kmaustral

Came here to request the same. I routinely paste links to PDFs and other resources that don't have titles and the plugin keeps embedding the markdown version of the link when it isn't necessary.

Would be great if we could have the following option:

Trigger only on default paste command [ ]

davecan avatar Jan 28 '22 13:01 davecan

I'm not familiar with the Obsidian plugin API but if this is the complete API it may be that the Obsidian devs don't expose the plain text paste event for public hook?

https://github.com/obsidianmd/obsidian-api/blob/master/obsidian.d.ts

davecan avatar Jan 28 '22 13:01 davecan

That's correct from what I can tell @davecan, the "editor-paste" command doesn't give me any information as to how the paste itself happened.

At the moment the closest thing I can find is to basically invert the bindings you're thinking of with:

  1. Disable "Enhance Default Paste" in the Auto Link Title options.
  2. Bind the "Auto Link Title: Paste URL and auto fetch title" hotkey to ctrl + shift + v

Technically you can bind it to ctrl + v and get the binding you're thinking of but it breaks pasting into Find dialogues etc.

zolrath avatar Jan 30 '22 19:01 zolrath

Here's how another plugin does it:

https://github.com/ganesshkumar/obsidian-excel-to-markdown-table/blob/71917841c6855889193e7df5e1dd8aa77dc58e63/src/main.ts#L10-L14

// Check for `Shift + Mod + V` triggered event.
// Do not handle `Shift + Mod + V` events.
if (evt.clipboardData.types.length === 1 && evt.clipboardData.types[0] === 'text/plain') {	
	return;
}

rrherr avatar Apr 21 '22 17:04 rrherr

I would also love this feature. On mac, cmd-shift-v is "paste as plain text". It would be fantastic to have that shortcut circumvent the auto-replacement of urls. I would also give me an easy workaround for pasting code in codeblocks, re #36

daeh avatar Sep 24 '22 22:09 daeh

+1

electblake avatar Apr 04 '23 18:04 electblake