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

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