39 lines
930 B
Nix
39 lines
930 B
Nix
|
{...}: {
|
||
|
programs.nixvim.plugins.cmp = {
|
||
|
enable = true;
|
||
|
settings = {
|
||
|
sources = [
|
||
|
{
|
||
|
name = "nvim_lsp";
|
||
|
priority = 10;
|
||
|
}
|
||
|
{
|
||
|
name = "treesitter";
|
||
|
priority = 6;
|
||
|
}
|
||
|
{
|
||
|
name = "luasnip";
|
||
|
priority = 8;
|
||
|
}
|
||
|
{
|
||
|
name = "path";
|
||
|
priority = 0;
|
||
|
}
|
||
|
];
|
||
|
snippet.expand = "luasnip";
|
||
|
completion = {
|
||
|
autocomplete = false;
|
||
|
};
|
||
|
mapping = {
|
||
|
"<C-Space>" = "cmp.mapping.complete()";
|
||
|
"<C-e>" = "cmp.mapping.close()";
|
||
|
"<CR>" = "cmp.mapping.confirm({ select = true })";
|
||
|
"<C-b>" = "cmp.mapping.scroll_docs(-4)";
|
||
|
"<C-f>" = "cmp.mapping.scroll_docs(4)";
|
||
|
"<C-p>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
|
||
|
"<C-n>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
}
|