This commit is contained in:
meml0rz
2024-11-12 01:38:49 +01:00
parent dccba03a3c
commit c2ee629754

View File

@ -5,7 +5,7 @@
cmp-path.enable = true;
cmp-buffer.enable = true;
cmp = {
enable = true;
enable = true;
autoEnableSources = true;
settings = {
sources = [
@ -14,33 +14,32 @@
{name = "buffer";}
{name = "luasnip";}
];
mapping = {
__raw = ''
mapping = cmp.mapping.preset.insert({
["<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" }),
mapping = {
__raw = ''
"<Tab>" = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
else
fallback()
end
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 }),
}),
'';
"<S-Tab>" = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
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 })";
};
};
};