mirror of
https://github.com/lightly-toasted/nix-config.git
synced 2025-10-04 07:25:40 +00:00
35 lines
830 B
Nix
35 lines
830 B
Nix
{
|
|
programs.nixvim.plugins.cmp = {
|
|
enable = true;
|
|
autoEnableSources = true;
|
|
settings = {
|
|
sources = [
|
|
{ name = "nvim_lsp"; }
|
|
{ name = "path"; }
|
|
{ name = "buffer"; }
|
|
];
|
|
mapping = {
|
|
"<Tab>" = ''
|
|
cmp.mapping(function(fallback)
|
|
if cmp.visible() then
|
|
cmp.select_next_item()
|
|
else
|
|
fallback()
|
|
end
|
|
end, { "i", "s" })
|
|
'';
|
|
"<S-Tab>" = ''
|
|
cmp.mapping(function(fallback)
|
|
if cmp.visible() then
|
|
cmp.select_prev_item()
|
|
else
|
|
fallback()
|
|
end
|
|
end, { "i", "s" })
|
|
'';
|
|
"<C-Space>" = "cmp.mapping.complete()";
|
|
"<CR>" = "cmp.mapping.confirm({ select = true })";
|
|
};
|
|
};
|
|
};
|
|
}
|