michal-h21 / vim-zettel

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

Template not applied when using ZettelNew #53

Closed adamjt closed 4 years ago

adamjt commented 4 years ago

.vimrc

Plug 'vimwiki/vimwiki'
Plug 'michal-h21/vim-zettel'
let g:vimwiki_list = [{'path': '~/SynologyDrive/zettelkasten/', 'ext': '.txt'}]
let g:zettel_options = [{'template' : '/Users/adam/.vim/zettel_templates/default.tpl'}]
let g:zettel_format = "%raw_title"

I'm using the .txt extension here so I can easily view the files on my phone using the Synology Drive app. The files themselves are in vimwiki syntax.

default.tpl

= %title =

When using :ZettelNew Something a file named Something.txt is created, but the contents are using the default template:

%title Something
%date 2020-08-05 18:01
michal-h21 commented 4 years ago

Hi, sorry for the late reply. I think this is the same issue as this one. It should be fixed now.

adamjt commented 4 years ago

Thanks! It works better now, but it's appending my template to the default, rather than replacing. I'm gonna see if I can figure it out later today and try to open a PR. If I can't, I'll follow up here!

michal-h21 commented 4 years ago

Yes, the default headers are always applied, they are independent on the template. Maybe we can introduce a option to disable the default headers?

adamjt commented 4 years ago

Oh, sorry for the confusion! I think that would be neat, I keep the pages pretty simple.

michal-h21 commented 3 years ago

It is possible to disable front matter now, using disable_front_matter option:

 let g:zettel_options = [{"template" :  "~/scratchbox/vimwiki/mdtemplate.tpl", "disable_front_matter": 1}]
adamjt commented 3 years ago

Thanks so much! Can confirm it works great.