Closed geblanco closed 2 years ago
I have been researching a little bit more the wiki_nr
. When entering wiki mode from any zettel function, the default is set to 0 (because getbufvar("%", "vimwiki_wiki_nr") == -1
evaluates to true, afterwards, when the file is saved, the wiki plugin sets the wiki_nr
to the index of the wiki where the file is saved, that is, in case of non-0 zettel wiki, defaulting to 0 results in a bad file_no
count, but, after saving, the wiki_nr
is set correctly. This happens here, inserting a call to echo vimwiki#vars#get_wikilocal('path')
before and after the save call helps visualizing this effect.
I have fixed this in my fork of this project and sent a PR!
Best,
Hello!
First of all, thanks for this great package you're crafting!
I write this as a separate issue to #10 because it seems to be a somewhat different error.
When running ZettelCapture on a file that is not saved yet, it outputs:
though it saves the file to my zettel wiki.
When running it with the file saved (e.g.: in
/tmp/my_zettel_to_capture.txt
), it doesn't fail, but I think there are some filename parsing problems. For me, intuitively, it should gather the filename (my_zettel_to_capture.txt
) and use it as title, though examining the code, it seems to parse something in the form= title: <> =
inside the file?. Having this inside it doesn't seem to work (maybe I'm miswriting it?)Example file:
And, in any case, setting the file_no fails. I have two separate wikis, one for non-zettel stuff (my previous wiki) and another one for zettel (just started using it). I think it is properly configured to use the second wiki (
~/zettel
directory), but when setting thefile_no
from ZettelCapture, it uses the count from the main wiki. Here is the zettel-related config from my.vimrc
:I think it has to do with the default wiki number, when inside the wiki (operating with the zettelkasten), one can run ZettelSetActiveWiki with the proper number, and (I guess) everything works well, but, without calling it, or running from the outside, it is not properly configured. Again, inspecting the code, I see that
vimwiki_wiki_nr
is just a buff variable. I'm guessing this can be appropriate when editing different zettels stored in different wikis, though it seems like an extreme use case, maybe it could be better to store it as an option in.vimrc
and avoid this kind of issues? E.g.:Maybe I can prepare a PR if we settle on some of these.
What do you think?
Best,