This commit is contained in:
meml0rz
2024-11-12 01:15:21 +01:00
parent 7c585ddf73
commit dccba03a3c
2 changed files with 38 additions and 29 deletions

View File

@ -7,33 +7,42 @@
cmp = { cmp = {
enable = true; enable = true;
autoEnableSources = true; autoEnableSources = true;
sources = [ settings = {
{name = "nvim_lsp";} sources = [
{name = "path";} {name = "nvim_lsp";}
{name = "buffer";} {name = "path";}
{name = "luasnip";} {name = "buffer";}
]; {name = "luasnip";}
mapping = { ];
"<CR>" = "cmp.mapping.confirm({ select = true })"; mapping = {
"<Tab>" = { __raw = ''
action = '' mapping = cmp.mapping.preset.insert({
function(fallback) ["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
cmp.select_next_item() cmp.select_next_item()
elseif luasnip.expandable() then else
luasnip.expand() fallback()
elseif luasnip.expand_or_jumpable() then end
luasnip.expand_or_jump() end, { "i", "s" }),
elseif check_backspace() then
fallback() ["<S-Tab>"] = cmp.mapping(function(fallback)
else if cmp.visible() then
fallback() cmp.select_prev_item()
end else
end fallback()
''; end
modes = [ "i" "s" ]; end, { "i", "s" }),
};
}; ["<C-b>"] = cmp.mapping.scroll_docs(-4),
}; ["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<C-Left>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = false }),
}),
'';
};
};
};
}; };
} }

View File

@ -3,7 +3,7 @@
imports = [ imports = [
nixvim.homeManagerModules.nixvim nixvim.homeManagerModules.nixvim
./cmp.nix ./cmp.nix
#./lsp.nix ./lsp.nix
]; ];
programs.nixvim = { programs.nixvim = {
enable = true; enable = true;