Closed kabinspace closed 2 years ago
The tags
template variable doesn't exist when creating new notes. However, you can use a custom extra
variable for this:
---
title: {{ title }}
date: {{ date now "long" }}
tags: {{ extra.tags }}
---
{{content}}
Then you can use a similar method to set the extra variable with NeoVim:
n = { "<cmd>ZkNew { dir = vim.fn.expand('%:p:h'), title = vim.fn.input('Title: '), extra = { tags = vim.fn.input('Tags') }}<cr>", "New Notes" }
(Note that extra
is a dictionary, I'm not sure the above syntax is correct actually, I didn't test it out myself).
Great, the given solution works perfectly fine. Thank you :)
Since we can easily input our title from the nvim commandline like this:
Is there a way we could have same input option for tags as well? This is my
.zk/templates/default.md