jghauser / follow-md-links.nvim

Easily follow markdown links with this neovim plugin
GNU General Public License v3.0
143 stars 16 forks source link

Follow links specified in the reference style. #32

Closed printfdebugging closed 3 days ago

printfdebugging commented 1 week ago

Hi, Now reference style links are also supported.

some text [link to something] more text...

[link to something]: https://example.org
jghauser commented 5 days ago

Hi! Thanks you for contributing! :heart:

Can you tell me more about this link style? I'm asking because reference-style links seem to have a slightly different kind of syntax. It seems to be:

[hobbit-hole][1]

[1]: https://en.wikipedia.org/wiki/Hobbit#Lifestyle

This plugin already supports this syntax (as mentioned in the README).

printfdebugging commented 5 days ago

Well, I was frustrated because neovim's conceal system also considers the length of concealed text while wrapping. So I thought how can I minimize this length, and then I thought "let me see if it works like this", and it worked! Then I asked chatGPT about what this is called, it told me reference style.

the markdown-preview.nvim plugin shows it right, github, zola all show this style (the one I mention in comment 1). If it's some non-standard style. I thought of working on implementing it, the plugin was quite understandable, so I changed what seemed logical. It works :wink:

jghauser commented 5 days ago

Thanks for the explanation! I checked some more and this 'text only' reference-link style is indeed quite common (though some (e.g. gitlab) have a [link][] syntax. We might want to support that too eventually, but that doesn't need to happen in this PR.

If you could just add a line in the readme (right after the one explaining reference links) to document how text-only reference links work, that would be great. I'll merge the PR after that. Thanks!

printfdebugging commented 3 days ago

Sorry for being late, I went on a walk to the emacs lands far away, nice place! I added the [example link] text-only reference example to readme.

jghauser commented 3 days ago

No worries! I do get tempted by that land every now and then, though by now I've invested far too much into neovim to ever leave ahaha

Thanks for the readme edit and the PR in general!