summaryrefslogtreecommitdiff
path: root/mac/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua
diff options
context:
space:
mode:
Diffstat (limited to 'mac/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua')
-rw-r--r--mac/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua30
1 files changed, 30 insertions, 0 deletions
diff --git a/mac/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua b/mac/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua
new file mode 100644
index 0000000..90528a1
--- /dev/null
+++ b/mac/.config/TheSiahxyz/lua/TheSiahxyz/snippets/diary.lua
@@ -0,0 +1,30 @@
+local ls = require("luasnip")
+
+local s = ls.snippet
+local i = ls.insert_node
+local f = ls.function_node
+
+local fmt = require("luasnip.extras.fmt").fmta
+
+local diary_snippet = s(
+ "diary",
+ fmt(
+ [[---
+title: <title>
+date: <date>
+---
+
+<story>
+]],
+ {
+ title = i(1, "My Journal"),
+ date = f(function()
+ return os.date("%Y-%m-%d")
+ end, {}),
+ story = i(3),
+ }
+ )
+)
+
+ls.add_snippets("markdown", { diary_snippet })
+ls.add_snippets("quarto", { diary_snippet })