Format your copy-pasted text.
Chrome Web Store - Copy Formatter
I use Obsidian and every time I want to create an external link, I have to:
- select the text that I want to copy
- copy it
- get the URL
- copy it
- paste the text and surround it with
[] - paste the URL and surround it with
()
Only after running the above 6 steps I'd end up with [text](some_url.com). The steps that I took are repetitive and can be automated. So I decided to create this browser extension so people no longer have to go through the same ordeal as I did.
I personally use this for taking Obsidian markdown notes, however if you:
- take markdown notes
- regularly need to format your copied text in a programmatic way
...then Copy Formatter may be perfect for you!
Copy Formatter lets you format your recently copied text when you paste it.
- Select the text you want to copy
- Right click on the page, look for "Copy Formatter". It will show a list of available templates.
- Select from one of the templates. For example, if you choose "Copy as Markdown Link" (one of the default templates), when you paste the text, it will be pasted as a markdown link.
I am a Vim user and prefer to do things from my keyboard. I also use Vimium to browse the web. In Vim, you can use registers with " (:h quote in Vim). Just as you can store many texts in different registers, I figure you should be able to select one of the templates using ". I made Copy Formatter callable with " in addition to right click. This (hopefully) gives you a more Vim-like experience!
Suppose that you're browsing a website: https://daringfireball.net/projects/markdown/syntax#link. You see a body of text that you want to add to your notes. Let's say that you want to create an external link for the text: "Markdown supports two styles of links: inline and reference". Assuming you have Vimium installed, here's how you can take notes seamlessly without touching your mouse:
- Search with Vimium's search operator (
/). - Search for that text:
/Markdown supports two styles. - Switch to visual mode (
v) + go to the end of the line ($), or you can just use the visual line mode (V). - Exit the visual mode (Copy Formatter doesn't work while you're still in Vimium's visual mode).
- Press
". It will display a popup on the browser, showing a list of all different formats you can use to paste your text. You can traverse the list with the up/down arrows orCtrl-p/Ctrl-n. - Choose the first one: "Copy as Markdown Link".
- The text will be formatted in your clipboard as
[Markdown supports two styles of links: inline and reference.](https://daringfireball.net/projects/markdown/syntax#link). Neat!
Copy Formatter comes with predefined templates. They're configured for Obsidian syntax, but you can add / edit / remove them as needed. To do that, click on the Copy Formatter extension icon, select "Configure". You should see a list of all the available templates.