nix-config/users/tacocat/neovim/cmp.nix
2024-03-23 11:56:39 -04:00

50 lines
1.1 KiB
Nix

{...}: {
programs.nixvim.plugins.cmp = {
enable = true;
filetype = {
tex = {
sources = [
{name = "latex_symbols";}
];
};
};
settings = {
sources = [
{
name = "nvim_lsp";
priority = 10;
}
{
name = "treesitter";
priority = 6;
}
{
name = "luasnip";
priority = 8;
}
{
name = "path";
priority = 0;
}
{
name = "buffer";
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'})";
};
};
};
}