neogen
neogen copied to clipboard
Could not get neogen to work with LazyVim
My configs are:
{
"danymat/neogen",
config = true,
-- Uncomment next line if you want to follow only stable versions
version = "*"
}
I came up with this. I am currently wondering how to integrate it with native snippets support of neovim>=0.10. Please reply if someone figures it out.
return {
"danymat/neogen",
dependencies = "nvim-treesitter/nvim-treesitter",
cmd = "Neogen",
keys = {
{
"<leader>ga",
function()
require("neogen").generate({})
end,
desc = "Generate Annotations",
},
},
---@param _ LazyPlugin
---@param opts table
opts = function(_, opts)
local util = require("lazyvim.util")
if util.has("luasnip") then
opts.snippet_engine = "luasnip"
elseif util.has("snippy") then
opts.snippet_engine = "snippy"
end
end,
}
@rabinadk1 native snippet support has been added according to this issue. Just set snippet_engine to nvim.
@rabinadk1 native snippet support has been added according to this issue. Just set
snippet_enginetonvim.
Thank you very much. I have updated my config to the following.
return {
"danymat/neogen",
dependencies = "nvim-treesitter/nvim-treesitter",
cmd = "Neogen",
keys = {
{
"<leader>ga",
function()
require("neogen").generate({})
end,
desc = "Generate Annotations",
},
},
---@param _ LazyPlugin
---@param opts table
opts = function(_, opts)
local snippet_engine = nil
if vim.snippet ~= nil then
snippet_engine = "nvim"
else
local util = require("lazyvim.util")
if util.has("luasnip") then
snippet_engine = "luasnip"
elseif util.has("snippy") then
snippet_engine = "snippy"
elseif vim.g.loaded_vsnip then
snippet_engine = "vsnip"
end
end
opts.snippet_engine = snippet_engine
end,
}
Weird, do you still have the issue loading Neogen ?