michal-h21 / vim-zettel

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

ZettelSetActiveWiki and multiple Wikis #111

Open MaralWa opened 3 years ago

MaralWa commented 3 years ago

I have a main VimWiki for general topics and several project related VimWikis.

If I call ZettelOpen while I am editing a file of my main Wiki ZettelOpen behaves as expect. For example when I call ZettelOpen and search notes containing topic the result list contains topic.md and I can open it with RETURN. When I call the function :messages the messages are:

[DEBUG] filename: topic.md
[DEBUG] wikiname: topic
[DEBUG] dir: /Users/Maral/Documents/vimwiki/
[DEBUG] wikidir: /Users/Maral/Documents/vimwiki/

ZettelOpen opened file /Users/Maral/Documents/vimwiki/topic.md

Now I switch to another wiki by opening the index file of the other vimwiki, for example /Users/Maral/Documents/otherwiki/index.md If call ZettelOpen the result list always contains only notes from the main wiki.

othervimwiki does not contain any note with the word topic but it does contain notes with the word second. But :ZettelOpen second does not find any results. If call :ZettelOpen topic (remember I am still in otherwiki) the result list contains the note topic.md from my main wiki. But if I hit RETURN ZettelOpen opens the note /Users/Maral/Documents/otherwiki/topic.md which is empty because it did exist in otherwiki before.

Why this happened I understood when called :messages:

[DEBUG] filename: topic.md
[DEBUG] wikiname: topic
[DEBUG] dir: /Users/Maral/Documents/vimwiki/
[DEBUG] wikidir: /Users/Maral/Documents/otherwiki/

These were the messages after I had called :ZettelOpen topic while I edited /Users/Maral/Documents/otherwiki/index.md, i.e. the index of otherwiki. Hence the issue is that ZettelOpen search in directory dir but opens results relative to wikidir:

My conclusions are

Ciao

Maral

michal-h21 commented 2 years ago

Hi, sorry for the late reply. I am now going over older issues and I am trying to fix them.

I think this issue was fixed in the meantime, ZettelOpen now lists only notes from the currently selected wiki, and you can select a different wiki using ZettelSetActiveWiki. It shouldn't matter in which directory you are.