Astronvim config from kabinspace/AstroNvim_user

This commit is contained in:
Ismo Vuorinen
2023-02-13 15:55:27 +02:00
parent f502b5458f
commit b1d979df34
33 changed files with 1646 additions and 19 deletions

32
plugins/cmp.lua Normal file
View File

@@ -0,0 +1,32 @@
local cmp = require "cmp"
local luasnip = require "luasnip"
return {
completion = {
completeopt = "menu,menuone,noinsert",
},
window = {
documentation = {
max_width = 40,
},
},
mapping = {
["<C-p>"] = cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Select },
["<C-n>"] = cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Select },
["<C-k>"] = cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Select },
["<C-j>"] = cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Select },
["<Tab>"] = cmp.mapping(function(fallback)
if luasnip.jumpable(1) then
luasnip.jump(1)
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
},
}