Update 2025-10-31

update 2025-10-08

chore: update readme

Update 2025-10-09

Update 2025-10-15

Update 2025-10-22

Update 2025-10-31
This commit is contained in:
2025-10-08 19:54:46 +03:00
parent f7194a919e
commit f5c52bcc9d
65 changed files with 1052 additions and 1721 deletions

54
snippets/lua.lua Normal file
View File

@@ -0,0 +1,54 @@
---@diagnostic disable: undefined-global
local require_var = function(args, _)
local text = args[1][1] or ""
local split = vim.split(text, ".", { plain = true })
local options = {}
for len = 0, #split - 1 do
table.insert(options, t(table.concat(vim.list_slice(split, #split - len, #split), "_")))
end
return sn(nil, {
c(1, options),
})
end
return {
s(
"lf",
fmt(
[[
local function {}({})
{}
end
]],
{
i(1),
i(2),
i(0),
}
)
),
s(
"fn",
fmt(
[[
function({})
{}
end
]],
{
i(1),
i(0),
}
)
),
s(
"req",
fmt([[ local {} = require("{}") ]], {
d(2, require_var, { 1 }),
i(1),
})
),
}