-
Notifications
You must be signed in to change notification settings - Fork 72
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
Consistent relative linking #72
Comments
+1. |
I'm also interested in this feature, I have the same issue. @michal-h21 , I'd like to try creating a PR for it.
So should zettel#vimwiki#format_search_link do the figuring out of what the relative path between "where we are" and "what we want to link to" should be? |
@rfhlmn I think it should work after the latest update if I understand it correctly. When I have a document in |
@michal-h21 , that part works great, it's the other way around that doesn't: If I'm in |
@rfhlmn ah, OK, now I understand. If you want to try it, I will gladly accept the PR. |
@michal-h21 , cool! Is my understanding in the comment above correct? Is zettel#vimwiki#format_seach_link the correct place to do that? |
@rfhlmnmaybe. you get the relative path to the wiki root in the formatting function, so you would need to test if the current file is in a subdirectory of the wiki root and add necessary |
@michal-h21 , yeah, the logic of it I'll still have to figure out, to make it robust. |
What I would like to achieve is a linking behaviour relative to the current file:
That means, if I am in
subdirectory/note1.md
of my wiki, type[[
to invoke the fuzzy search andnote2.md
in the root directory, it should enter[[../note2]]
as a link.subdirectory/note3.md
it should enter[[note3]]
as a link.Also, when I am in
note2.md
in the root directory andsubdirectory/note1.md
, it should enter[[subdirectory/note1]]
as a link.note4.md
in the root directory, it should enter[[note4]]
as a link.That would be consistent with the behaviour of invoking the autocomplete from vimwiki with Ctrl-x Ctrl-o. But of course, here I have to start typing
../no
or/no
first, depending on where I am in my wiki, and I have to know the beginning of the filename, because it's not a fuzzy search.Additionally, this is basically the behaviour of Obsidian when choosing the option to create new links relative to the current file. I would like to achieve consistency also with that to be able to edit my notes from Obisdian and from vim, while keeping the ability to follow links from within both programms.
The text was updated successfully, but these errors were encountered: