mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-21 08:35:53 +02:00
## Description Configure neogen and mini.snippets integration. See also #5593. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines.
37 lines
748 B
Lua
37 lines
748 B
Lua
return {
|
|
"danymat/neogen",
|
|
dependencies = LazyVim.has("mini.snippets") and { "mini.snippets" } or {},
|
|
cmd = "Neogen",
|
|
keys = {
|
|
{
|
|
"<leader>cn",
|
|
function()
|
|
require("neogen").generate()
|
|
end,
|
|
desc = "Generate Annotations (Neogen)",
|
|
},
|
|
},
|
|
opts = function(_, opts)
|
|
if opts.snippet_engine ~= nil then
|
|
return
|
|
end
|
|
|
|
local map = {
|
|
["LuaSnip"] = "luasnip",
|
|
["mini.snippets"] = "mini",
|
|
["nvim-snippy"] = "snippy",
|
|
["vim-vsnip"] = "vsnip",
|
|
}
|
|
|
|
for plugin, engine in pairs(map) do
|
|
if LazyVim.has(plugin) then
|
|
opts.snippet_engine = engine
|
|
return
|
|
end
|
|
end
|
|
|
|
if vim.snippet then
|
|
opts.snippet_engine = "nvim"
|
|
end
|
|
end,
|
|
}
|