flake/nixos/nvim/plugins/cmp.nix
2025-04-11 21:29:46 -05:00

59 lines
1.5 KiB
Nix

{
pkgs,
copilot-lsp-fix,
lib,
...
}:
{
programs.nixvim = {
extraPackages = with copilot-lsp-fix; [ copilot-language-server-fhs ];
plugins = {
cmp = {
enable = true;
settings = {
sources = [
{
name = "copilot";
group_index = 2;
}
{
name = "luasnip";
group_index = 2;
}
{
name = "nvim_lsp";
group_index = 2;
}
{
name = "buffer";
group_index = 2;
}
{
name = "path";
group_index = 2;
}
];
mapping = {
"<C-Space>" = "cmp.mapping.complete()";
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
"<C-e>" = "cmp.mapping.close()";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<CR>" = "cmp.mapping.confirm({ select = false })";
"<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
};
};
};
copilot-lua = {
enable = true;
nodePackage = pkgs.nodejs_22;
settings = {
suggestion.enabled = false;
panel.enabled = false;
lsp_binary = lib.getExe copilot-lsp-fix.copilot-language-server-fhs;
};
};
copilot-cmp.enable = true;
};
};
}