nvim: add neogen

This commit is contained in:
2023-07-08 15:20:42 +03:00
parent 49fab16d82
commit 8db5f38582
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" },