summaryrefslogtreecommitdiff
path: root/ar/.config/TheSiahxyz/lua/thesiahxyz/snippets/quarto.lua
diff options
context:
space:
mode:
Diffstat (limited to 'ar/.config/TheSiahxyz/lua/thesiahxyz/snippets/quarto.lua')
-rw-r--r--ar/.config/TheSiahxyz/lua/thesiahxyz/snippets/quarto.lua28
1 files changed, 28 insertions, 0 deletions
diff --git a/ar/.config/TheSiahxyz/lua/thesiahxyz/snippets/quarto.lua b/ar/.config/TheSiahxyz/lua/thesiahxyz/snippets/quarto.lua
new file mode 100644
index 0000000..74b9fb8
--- /dev/null
+++ b/ar/.config/TheSiahxyz/lua/thesiahxyz/snippets/quarto.lua
@@ -0,0 +1,28 @@
+local ls = require("luasnip")
+
+local s = ls.snippet
+local i = ls.insert_node
+local t = ls.text_node
+-- local d = ls.dynamic_node
+local c = ls.choice_node
+-- local f = ls.function_node
+-- local r = ls.restore_node
+local fmt = require("luasnip.extras.fmt").fmta
+-- local h = require("thesiahxyz.utils.snippet")
+
+local code_cell_snippet = s(
+ "`",
+ fmt(
+ [[```<lang>
+<last>
+``]],
+ {
+ lang = c(1, { t("python"), t("") }),
+ last = i(0), -- Place cursor here after expanding the snippet
+ }
+ )
+)
+
+-- Add the snippets for multiple filetypes
+ls.add_snippets("markdown", { code_cell_snippet })
+ls.add_snippets("quarto", { code_cell_snippet })