From c489d393695e90d424f9ae51e35c4d42358e6a71 Mon Sep 17 00:00:00 2001 From: Squibid Date: Fri, 9 Aug 2024 02:45:31 -0400 Subject: yes there's a bit of java in my nvim config why do you ask? --- lua/snippets/norg.lua | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 lua/snippets/norg.lua (limited to 'lua/snippets/norg.lua') diff --git a/lua/snippets/norg.lua b/lua/snippets/norg.lua new file mode 100644 index 0000000..d96a471 --- /dev/null +++ b/lua/snippets/norg.lua @@ -0,0 +1,28 @@ +require('core.snippets.shorthands') + +local function file_name(args, parent, user_args) + return vim.fn.expand("%:t:r") +end + +return { + -- header level 1, usually this has the same name as the file + s("h1", { + t("* "), + c(1, { + f(file_name, {}), + i(1, "header") + }) + }), + + -- link snippet + s("link", { + t("{"), + c(1, { + sn(nil, { t({":$/"}), i(1, "path to file"), t(":") }), + i(1, "https://example.com") + }), + t("}["), + i(2, "description"), + t("]") + }) +} -- cgit v1.2.1