1
0

fix alias and copy-mode

This commit is contained in:
2025-04-03 19:20:29 +02:00
parent 3993cd733e
commit d372b7c89b
4 changed files with 28 additions and 20 deletions

View File

@@ -1,6 +1,15 @@
globals = {
"vim",
-- Rerun tests only if their modification time changed.
cache = true
ignore = {
"122", -- Setting a read-only field of a global variable.
"212", -- Unused argument, In the case of callback function, _arg_name is easier to understand than _, so this option is set to off.
}
-- Global objects defined by the C code
read_globals = {
"vim",
"Snacks",
}
files["snippets/*.lua"] = { ignore = { "211", "631" } }

View File

@@ -10,23 +10,20 @@ return {
config = function()
local ls = require("luasnip")
local snippets_folder = vim.fn.stdpath("config") .. "/snippets"
local function load_snippets()
-- Load all Lua files in the snippets directory except init.lua
local files = vim.fn.glob(snippets_folder .. "/*.lua", false, true)
for _, file in ipairs(files) do
local filename = vim.fn.fnamemodify(file, ":t")
-- Remove .lua extension to get the filetype
local ft = filename:match("(.+)%.lua$")
if ft then
-- Load the file which should return a table of snippets
local ok, snippets = pcall(dofile, file)
if ok and type(snippets) == "table" then
ls.add_snippets(ft, snippets)
end
-- Load all Lua files in the snippets directory except init.lua
local files = vim.fn.glob(snippets_folder .. "/*.lua", false, true)
for _, file in ipairs(files) do
local filename = vim.fn.fnamemodify(file, ":t")
-- Remove .lua extension to get the filetype
local ft = filename:match("(.+)%.lua$")
if ft then
-- Load the file which should return a table of snippets
local ok, snippets = pcall(dofile, file)
if ok and type(snippets) == "table" then
ls.add_snippets(ft, snippets)
end
end
end
load_snippets()
end,
},
{