-
Notifications
You must be signed in to change notification settings - Fork 167
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
Feature: Insert Internal Links With Completion #205
Comments
Thanks for this suggestion. As you mentioned, the variation in implementation details across different Markdown processors is an issue, but I could probably handle that by letting users set a customizable heading-to-anchor-id transformation function. It's made more difficult because some processors allow using inline attribute lists to define the Regarding the confusion about multiple link functions: the link functions and keybindings are somewhat in flux right now ahead of v2.3. In light of the new markup/url hiding functionality, I have added the new function Currently, insertion commands are scattered around under C-c C-a, C-c C-s, C-c C-t, and elsewhere. Those are remnants from |
Thanks, that all sounds good. I'll just say that wherever possible, please use completing-read with a collection and then things like ivy, helm, ido will make entering info very easy. Looks like you're doing this in some places already. If you're changing key bindings, let me say, I hate the prefix C-c C-x. I know other modes use it (like |
Great. Yes, I'm using completion for URLs, reference labels, etc. in the new link insertion/editing function (and am planning to add elsewhere as I go). The plan is to move all markup insertion/replacement (styling) commands under C-c C-s, where some of them already live. I've been consolidating mode-type toggles under C-c C-x, but I don't plan to use it for common functions. Edit: I'll also keep the old keybindings around for the next version or so, in cases where it's possible (almost all cases). |
@jrblevin: The version I use (2.4-dev) has auto-completion for document headings (anchors) using
It would be great if it also picked up the heading name and inserted a link like that:
|
I saw this http://pragmaticemacs.com/emacs/insert-internal-org-mode-links-the-ivy-way/ and wondered if it would be a useful idea for
markdown-mode
.My thought was an easy way to make internal links like #Heading1 or any other ids defined in the document using completion. I'm not sure
markdown-mode
knows the format of generated ids for headings that themarkdown-command
will use, but maybe that's standard or some substitute could be used. Bonus points if clicking on the link would move point to the referenced location in the document.This code unfortunately uses a worf function but it could depend on just
org-heading-components
which I'm not suremarkdown-mode
has a direct equivalent of (it must come close sinceimenu
works though I realize buffer positions and named anchors or ids are different).I typically just insert links like [text](url) via a function that grabs the current url of my browser. In investigating this idea I looked at the various
markdown-mode
link commands and got confused. Maybe this is just whatmarkdown-insert-wiki-link
is for and I'm just asking for a version of that command with completion. I looked at the menu and tried Insert Wiki Link. After typingC-c C-a
, which-mode showed me six commands bound to that prefix though only two are shown in the menu. I saw thatmarkdown-insert-reference-link-dwim
had two bindings but was obsolete. That was fine and it told me to usemarkdown-insert-link
instead but I wondered why that had no key binding and the obsolete function had two.The text was updated successfully, but these errors were encountered: