chore: add hugo+knap

This commit is contained in:
Mariano Z. 2025-03-20 14:15:45 -03:00
parent d75777ef85
commit a0591215a8
Signed by: marianozunino
GPG key ID: 4C73BAD25156DACE
9 changed files with 222 additions and 31 deletions

View file

@ -1,20 +1,59 @@
local M = {
"L3MON4D3/LuaSnip",
version = "v2.*",
build = "make install_jsregexp",
dependencies = {
"rafamadriz/friendly-snippets",
-- "saadparwaiz1/cmp_luasnip",
},
build = "make install_jsregexp",
}
M.config = function()
local ls = require("luasnip")
local s = ls.snippet
local t = ls.text_node
local i = ls.insert_node
ls.setup({
history = true, -- Allow jumping back into snippets
update_events = "TextChanged,TextChangedI", -- Update snippets as you type
-- Make sure LuaSnip works well with blink.cmp
region_check_events = "CursorMoved,CursorHold,InsertEnter",
delete_check_events = "TextChanged,InsertLeave",
})
-- Markdown code block snippets with multiple language support
local code_block_langs = {
bash = "bash",
go = "go",
python = "python",
javascript = "javascript",
typescript = "typescript",
rust = "rust",
lua = "lua",
cpp = "cpp",
json = "json",
html = "html",
css = "css",
}
local code_block_snippets = {}
for trigger, lang in pairs(code_block_langs) do
table.insert(
code_block_snippets,
s({ trig = "`" .. trigger, regTrig = false, snippetType = "autosnippet" }, {
t({ "", "```" .. lang }),
t({ "", "" }),
i(1, "# your " .. lang .. " code here"),
t({ "", "```" }),
})
)
end
ls.add_snippets("markdown", code_block_snippets)
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_vscode").lazy_load({ paths = vim.fn.stdpath("config") .. "/lua/plugins/snippets/" })
require("luasnip").config.set_config({
history = true,
updateevents = "TextChanged,TextChangedI",
})
end
return M