Use filename instead of the title when auto-completing wiki-links
See original GitHub issueHello, thank you for creating this project, it looks really useful!
My usecase is that I have a Zettelkasten repository containing a lot of interlinked notes with generated filenames. For example, my typical note might have a filename 202208240944.md
and a content like this:
# Some title here
Lorem ipsum
If I try to link to this note from another file, I can type [[some
and I will correctly get a list of suggestions with this note on the top. However, if I decide to use that suggestion, the result will become [[some-title-here]]
instead of [[202208240944]]
. In other words, marksman
seems to assume that the title directly translates to the filename - but I think that is often not the case.
I’ve tried to use it with Kakoune (using kak-lsp) and Helix and both editors show the same behavior.
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:13 (6 by maintainers)
Hi @MilanVasko! This is the expected behavior — my assumption was that when doing Zettelkasten style note taking, each note’s title should be unique to the note (otherwise, how would you tell them apart?). Therefore it’s fine to use the title’s slug rather than the file name in the link because it’s easier to tell what the link refers to when you have
[[some-title-here]]
vs[[202208240944]]
.I think it should be possible to make this behavior configurable, e.g. in .marksman.toml we could have a section
But I’d like to first learn more about your case.
Could you give an example where the assumption about the title is not true?
I haven’t followed the PR discussion nor studied the code so I’m not aware of any lurking edge cases, but I tried the latest release with the
wiki.style = "file-stem"
option and it seems to work correctly for my needs, so I’ll go ahead and close this issue.I’ll definitely start using this for my notes and I’ll reopen if I encounter any problems.
Thanks a lot! 🙂