{
opts = {
completeopt = [ "menu" "menuone" "noselect"];
};
extraConfigLua = ''
vim.opt.shortmess:append "c"
'';
plugins = {
cmp = {
enable = true;
settings = {
sources = [
{ name = "nvim_lsp"; }
{ name = "async_path"; }
{ name = "buffer"; }
];
mapping = {
"<C-n>" = "cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Insert }";
"<C-p>" = "cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Insert }";
"<C-y>" = ''
cmp.mapping(
cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Insert,
select = true,
},
{ "i", "c" }
)
'';
"<C-space>" = ''
cmp.mapping(function()
if cmp.visible() then
cmp.close()
else
cmp.complete()
end
end)
'';
};
};
};
cmp-async-path.enable = true;
cmp-buffer.enable = true;
cmp-nvim-lsp.enable = true;
lspkind = {
enable = true;
cmp.enable = true;
};
};
}