nvim: add neogen

This commit is contained in:
mequidis
2023-01-20 23:01:22 +02:00
parent 53bba16f7d
commit 1a3fef2864
4 changed files with 43 additions and 0 deletions

View File

@ -132,3 +132,8 @@ end)
vim.keymap.set("v", "<leader>rr", function()
require("refactoring").select_refactor()
end)
-- neogen
vim.keymap.set("n", "<leader>rn", function()
require("neogen").generate()
end)

View File

@ -112,6 +112,14 @@ require("lazy").setup({
},
},
-- neogen
{
"danymat/neogen",
config = function()
require("plugins.neogen")
end,
},
-- neotest
{
"nvim-neotest/neotest",

View File

@ -1,6 +1,7 @@
vim.opt.completeopt = { "menuone", "noselect" }
local cmp = require("cmp")
local neogen = require("neogen")
cmp.setup({
snippet = {
@ -19,6 +20,26 @@ cmp.setup({
behavior = cmp.ConfirmBehavior.Replace,
select = false,
}),
["<tab>"] = cmp.mapping(function(fallback)
if neogen.jumpable() then
neogen.jump_next()
else
fallback()
end
end, {
"i",
"s",
}),
["<S-tab>"] = cmp.mapping(function(fallback)
if neogen.jumpable(true) then
neogen.jump_prev()
else
fallback()
end
end, {
"i",
"s",
}),
},
sources = {
{ name = "nvim_lsp" },

View File

@ -0,0 +1,9 @@
require("neogen").setup({
languages = {
python = {
template = {
annotation_convention = "reST",
},
},
},
})