61 lines
1.9 KiB
Lua
61 lines
1.9 KiB
Lua
-- The MIT License (MIT)
|
|
--
|
|
-- Copyright © 2026 Scott E. Graves <scott.e.graves@protonmail.com>
|
|
--
|
|
-- Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
-- and associated documentation files (the “Software”), to deal in the Software without restriction,
|
|
-- including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
|
-- sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
|
-- furnished to do so, subject to the following conditions:
|
|
--
|
|
-- The above copyright notice and this permission notice shall be included in all copies or
|
|
-- substantial portions of the Software.
|
|
--
|
|
-- THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
|
|
-- BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
-- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
--
|
|
if NV_DARCULA_ENABLE_COC then
|
|
return
|
|
end
|
|
|
|
local snippets = require("mini.snippets")
|
|
local gen_loader = snippets.gen_loader
|
|
local match_strict = function(snips)
|
|
return snippets.default_match(snips, {pattern_fuzzy = "%S+"})
|
|
end
|
|
|
|
snippets.setup {
|
|
mappings = {
|
|
expand = "",
|
|
jump_next = "",
|
|
jump_prev = "",
|
|
stop = "<Esc>"
|
|
},
|
|
expand = {match = match_strict},
|
|
snippets = {
|
|
gen_loader.from_file(
|
|
vim.fs.joinpath(vim.fn.stdpath("config"), "snippets", "global.json")
|
|
),
|
|
gen_loader.from_lang()
|
|
}
|
|
}
|
|
|
|
vim.api.nvim_set_hl(
|
|
0,
|
|
"MiniSnippetsCurrentReplace",
|
|
{link = "DiagnosticVirtualTextInfo"}
|
|
)
|
|
vim.api.nvim_set_hl(
|
|
0,
|
|
"MiniSnippetsFinal",
|
|
{link = "DiagnosticVirtualTextInfo"}
|
|
)
|
|
vim.api.nvim_set_hl(
|
|
0,
|
|
"MiniSnippetsVisited",
|
|
{link = "DiagnosticVirtualTextInfo"}
|
|
)
|