-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add yank (copy) markdown link of current tab #4240
base: master
Are you sure you want to change the base?
Conversation
This adds a new command, copyCurrentMarkdown, with a default keybinding `ym`, to copy a link to the current tab in markdown format, i.e. "[title](url)".
I'd love to see this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fantastic! Nice simple addition.
Could everyone who's interested in this elaborate on your use cases?
I'm concerned about adding a feature which is too narrow. Note that @gdh1995 has an implementation where the format of the copied text / URL can be customized, which allows the command to cover all use cases. If we went with a similar approach, then the command should probably be called |
|
Right now I use a simple Word file for notes - so HTML would be great. But for my workflow, the clipboard needs to have the content type text/html.
I use the command copyCurrentTitle to create the link in Word by hand. I think I wouldn't need it, if there was a command copyCurrentInfo
I need this for the current page and link hints. PS: I know Word is terrible in every way, but for now this is the easiest solution for me. |
|
My use-case is also to paste it into Slack or rich text documents (google Docs/Sheet, confluence, etc) or markdown editors. I think a better way would be to copy rich text ( Using native clipboard API, I can do it easily as const data = [new ClipboardItem({
'text/html': new Blob([`<a href="${document.location.href}">${document.title}</a>`], {type: 'text/html'}),
'text/plain': new Blob([document.title], {type: 'text/plain'})
})]
navigator.clipboard.write(data) Pasting this clipboard item into most markdown/rich-text editors works and they render it as they like. It further has the advantage of using Ctrl+Shift+V to paste as plain text. |
Use VimiumC like this:
Note: Change format as per your need. |
This would be a great feature. I like the generic approach taken by VimiumC: for example by allowing a
|
This adds a new command, copyCurrentMarkdown, with a default keybinding
ym
, to copy a link to the current tab in markdown format, i.e. "title".Description
Firstly, this has been suggested and implemented before, see PR #2054.
However, that pull request was never merged.
Having a way to copy a link in markdown format is implemented in other projects for keyboard-based browsing, for example qutebrowser. It is typically something a user expects to be able to do easily.
It relates to issues #131 #889 #2474 #3611 #4133