michal-h21 / vim-zettel

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

ZettelInsertNote fails with multiple wikis: Can't open file... #113

Closed rcmosher closed 2 years ago

rcmosher commented 2 years ago

ZettelInsertNote is not working for me. It is looking in the wrong directory. Instead of using the directory of the selected file to insert it uses the directory of the first wiki in g:vimwiki_list. It does this regardless of what ZettelSetActiveWiki is set to, or if a file from my zettel wiki is open.

It results in the following error.

Error detected while processing function 172[30]..29_callback[25]..function 172[30]..29_callback: line 23: Vim(let):E484: Can't open file /home/user/Documents/Vimwiki/210906-132626-14.md

My g:vimwiki_list is set as follows. I'd expect the 2nd wiki to be used. Though really it should just use the full path of the selected file.

  let g:vimwiki_list=[
    {'path': '~/Documents/Vimwiki/',
     'syntax': 'markdown', 'ext': '.md'},
    {'path': '~/Documents/Zettelkasten/',
     'syntax': 'markdown', 'ext': '.md', 'auto_tags': 1, 'auto_toc': 1}
  ]

I'm using Vim 8.2. vim-zettel is up to date.

michal-h21 commented 2 years ago

It should work correctly now.