nvim: add neogen
This commit is contained in:
@ -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)
|
||||
|
||||
@ -112,6 +112,14 @@ require("lazy").setup({
|
||||
},
|
||||
},
|
||||
|
||||
-- neogen
|
||||
{
|
||||
"danymat/neogen",
|
||||
config = function()
|
||||
require("plugins.neogen")
|
||||
end,
|
||||
},
|
||||
|
||||
-- neotest
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
|
||||
@ -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" },
|
||||
|
||||
9
.config/nvim/lua/plugins/neogen.lua
Normal file
9
.config/nvim/lua/plugins/neogen.lua
Normal file
@ -0,0 +1,9 @@
|
||||
require("neogen").setup({
|
||||
languages = {
|
||||
python = {
|
||||
template = {
|
||||
annotation_convention = "reST",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user