michal-h21 / vim-zettel

VimWiki addon for managing notes according to Zettelkasten method
MIT License
557 stars 73 forks source link

ZettelNew: run on non-vimwiki-buffer and directory to save new Zettel to #96

Closed kraxli closed 2 years ago

kraxli commented 3 years ago

Hi

thanks for the great plugin :-) . I would have suggestions regarding the creation of new Zettels and the logic to which directory to save a new Zettel / vimwiki-file.

Currently, ZettelNew works only if a vimwiki file is open (active buffer). It saves the new Zettel in the directory of the active vimwiki-buffer, in case this directory is specified as path in one of the vimwiki_list dictionaries.

  1. I have missed to create new Zettels out of the blue, e.g. as first action entering vim/neovim (i.e. empty buffer). I suggest to allow ZettelNew to work without active vimwiki-file.
  2. Additionally, I propose the following logical order to save the newly created wiki-file in:

    (1) the current directory if it is in the g:vimwiki_list paths (similar to current behaviour) (2) if (1) is not met, the directory-path of the first g:vimwiki_list with non-empty g:zettel_options (3) if (1) and (2) are not met, the directory-path given by the first g:vimwiki_list entry (4) else, vimwiki's default directory (e.g. ~/vimwiki/)

Please see also the update to doc/zettel.txt in this pull request.

Regards, David

michal-h21 commented 2 years ago

Thanks and sorry for the late merge. I was overwhelmed by the number of requests for my various projects, that I abandoned Vim-zettel for some time.