You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature Request] Keyboard shortcut for "reference-style" links #982
I would really like it if the cmd-k shortcut for inserting a link could insert reference-style links instead of (or as well as) inline links. By reference style I mean where the link is on a separate line and a unique identifier associates the URL with the linked text:
This is [an example][id] reference-style link.
[id]: http://example.com/
Usually if a link is particularly long I will use the reference-style to avoid adding too much noise to a particular paragraph.
How I imagine the interface could work would be for me to select some text, press cmd-k, have the selected text be wrapped in a square brackets, the link added from the clipboard on the next line, and then keyboard focus be in (both?) the places where the reference needs to be inserted.
You could have a simple heuristic to guess an ID based on the domain name (like example for example.com/whatever).
Thank you for the suggestion. I think what kind of link should be inserted with Cmd-K is largely a matter of personal preference. Personally, I rarely use reference-style links, but I also don't want to turn this into a configurable setting.
That said, I believe this need can be addressed well via an extension — please check MarkEdit-reference-style-links out.
As for the selection part, I may not have fully understood what you meant — please feel free to clarify your thoughts.
omg that's amazing! I agree this is pretty fiddly to add to the main app. The behaviour you've implemented with selection is what I was imagining.
I've tinkered on it a bit further to look for existing references with the same URL, and a very personal taste feature of inlining URLs that are <20 characters long. I've put that repo on Codeberg.
Activity
cyanzhong commentedon Aug 3, 2025
Thank you for the suggestion. I think what kind of link should be inserted with Cmd-K is largely a matter of personal preference. Personally, I rarely use reference-style links, but I also don't want to turn this into a configurable setting.
That said, I believe this need can be addressed well via an extension — please check MarkEdit-reference-style-links out.
As for the selection part, I may not have fully understood what you meant — please feel free to clarify your thoughts.
willhbr commentedon Aug 3, 2025
omg that's amazing! I agree this is pretty fiddly to add to the main app. The behaviour you've implemented with selection is what I was imagining.
I've tinkered on it a bit further to look for existing references with the same URL, and a very personal taste feature of inlining URLs that are <20 characters long. I've put that repo on Codeberg.
cyanzhong commentedon Aug 3, 2025
Cool. Feel free to use my approach as an example to do what you want.
By the way, I have updated my repo to make the keyboard shortcut configurable (without rebuilding).
Closing this now, thanks.