40 lines
904 B
Nix
40 lines
904 B
Nix
{ config, pkgs, nixvim, ...}:
|
|
{
|
|
programs.nixvim.plugins = {
|
|
cmp-nvim-lsp.enable = true;
|
|
cmp-path.enable = true;
|
|
cmp-buffer.enable = true;
|
|
cmp = {
|
|
enable = true;
|
|
autoEnableSources = true;
|
|
sources = [
|
|
{name = "nvim_lsp";}
|
|
{name = "path";}
|
|
{name = "buffer";}
|
|
{name = "luasnip";}
|
|
];
|
|
mapping = {
|
|
"<CR>" = "cmp.mapping.confirm({ select = true })";
|
|
"<Tab>" = {
|
|
action = ''
|
|
function(fallback)
|
|
if cmp.visible() then
|
|
cmp.select_next_item()
|
|
elseif luasnip.expandable() then
|
|
luasnip.expand()
|
|
elseif luasnip.expand_or_jumpable() then
|
|
luasnip.expand_or_jump()
|
|
elseif check_backspace() then
|
|
fallback()
|
|
else
|
|
fallback()
|
|
end
|
|
end
|
|
'';
|
|
modes = [ "i" "s" ];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|