LazyVim.LazyVim/lua/lazyvim/plugins/extras/coding/neogen.lua
Roland Kaminski 5788b9d1e0
feat(extras): setup neogen and mini.snippets integration (#5594)
## 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.
2025-02-14 17:32:33 +01:00

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,
}