michal-h21 / vim-zettel

VimWiki addon for managing notes according to Zettelkasten method
MIT License
555 stars 72 forks source link

Insert link with ZettelSearch uses filename instead of title #103

Closed gasperphoenix closed 2 years ago

gasperphoenix commented 3 years ago

Hi, I am able to create a new zettel using the shortcut. In this case the marked text is correctly used as title for my new zettel. = <TITLE> =

But when I search for a page using [[, select it and press enter a link is added that uses the filename for both the target and the link text. But I expect that it extracts the title from the target page and uses it as link title. My expectation: [[<LINK TARGET>|<TARGET TITLE>]] Observed behavior: [[<LINK TARGET>|<LINK TARGET>]]

Am I doing something wrong?

Please find attached my zettel template - I added the extension .txt to upload it to GitHub: zettel_template.tpl.txt

gasperphoenix commented 3 years ago

I created pull request #105 with an implementation to improve the behavior

Matt-Deacalion commented 2 years ago

I'm having the same issue.

I've just tried the patch by Dennis (@gasperphoenix) and it works perfectly with markdown files. Could this be merged?

michal-h21 commented 2 years ago

Thanks for the patch, title should be detected in the first heading now.