Automatically insert markdown formatted link if text is selected when pasting

A really small feature but it’s really neat in Typora. If you have a URL in clipboard and then with some text selected in a note, you press Ctrl + K, there’s no additional step to paste the link, say, by pressing Ctrl + V. The link from clipboard is inserted automatically.

P. S. Searched the forum for this suggestion, sorry if already been raised.

19 Likes

I like this idea too; other markdown editors behave similarly. I edited the title to be more descriptive—hope that’s okay!

2 Likes

I would also like to see this - one of my favorite and most missed features from Notion.

Given you have a markdown file containing: "You have a string of text."
And the OS Clipboard contains "https://obsidian.md/"
And the editor has the word string highlighted.
When you paste
The document updates to: "You have a [string](https://obsidian.md/) of text."

This feature is part of the Visual Studio complete ‘Markdown All in One’ extension.

3 Likes

when user press the Ctrl/Cmd + K, lookup clipbroad, if a URL inside, then place to

like Typora.

6 Likes

I wish that when I paste url it would be automatically wrapped in []() brackets, something like this:

[https://forum.obsidian.md/](https://forum.obsidian.md/)
or like this
[Change this title](https://forum.obsidian.md/)

Now I have to wrap them manually for every url I paste.

Check out the “Paste URL into selection” plugin from Denis Olehov. It’s available in the Third Party Plugins within the app.
Here’s the GitHub page if interested.

I’ve been using it for a while now with no issues. The only catch is to remind yourself to use CTRL/CMD + Shift + v instead of CTRL/CMD + v when you paste.

Hope that helps!

4 Likes

I’ve installed it and it’s a bit helpful but I wished it worked like in MarkText app - no selection required and pasting multiple links at once was possible. Anyway thanks for help.

The plugin mentioned by @Erisred already can do most of this. I’d suggest making a request in that repo for the case when there is no text selected.

Alternatively, you can use any of the markdown clippers mentioned here: How do I get content from websites into my notes?
Some of them offer the functionality to copy as markdown links.

3 Likes

You do not have to wrap manually if you simply change the order to:

  • select text
  • press and hold Ctrl
  • press K
  • press V
  • release Ctrl

For cases without selecting text it is best to use text expander like AutoHotkey(for Windows), Keyboard Maestro or Espanso to get consistent behavior in every desired application.

Simply use this plugin and set the shortcut to Cmd+K. Works flawlessly.