This commit is contained in:
meml0rz
2024-11-13 17:46:28 +01:00
parent dd9e21ccc5
commit 2a3c9a1ede
4 changed files with 81 additions and 46 deletions

View File

@ -16,18 +16,58 @@ let
in in
{ {
programs.nixvim.plugins = { programs.nixvim.plugins = {
blink-cmp = {
enable = true;
};
cmp = { cmp = {
enable = true; enable = true;
autoEnableSources = true; autoEnableSources = true;
settings = { settings = {
completion = {
keyword_length = 1;
completeopt = [
"menu"
"menuone"
"noinsert"
"noselect"
];
};
sorting = {
comparators = [
"require('cmp.config.compare').offset"
"require('cmp.config.compare').exact"
"require('cmp.config.compare').score"
"require('cmp.config.compare').recently_used"
"require('cmp.config.compare').locality"
"require('cmp.config.compare').kind"
"require('cmp.config.compare').length"
"require('cmp.config.compare').order"
];
};
mapping = { mapping = {
"<C-b>" = "cmp.mapping.scroll_docs(-4)"; "<C-Down>" = "cmp.mapping.scroll_docs(-4)";
"<C-f>" = "cmp.mapping.scroll_docs(4)"; "<c-Up>" = "cmp.mapping.scroll_docs(4)";
"<C-Space>" = "cmp.mapping.complete()"; "<C-Space>" = "cmp.mapping.complete()";
"<C-e>" = "cmp.mapping.abort()"; "<C-e>" = "cmp.mapping.abort()";
"<C-Left>" = "cmp.mapping.abort()"; "<C-Left>" = "cmp.mapping.abort()";
"<Up>" = "cmp.mapping.select_prev_item()"; "<Tab>".__raw = ''
"<Down>" = "cmp.mapping.select_next_item()"; cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
else
fallback()
end
end, { "i", "s" })
'';
"<S-Tab>".__raw = ''
cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end, { "i", "s" })
'';
"<CR>" = "cmp.mapping.confirm({ select = false })"; "<CR>" = "cmp.mapping.confirm({ select = false })";
}; };
@ -86,14 +126,6 @@ in
name = "git"; name = "git";
priority = 250; priority = 250;
} }
{
name = "calc";
priority = 150;
}
{
name = "emoji";
priority = 100;
}
]; ];
}; };
}; };

View File

@ -1,5 +1,7 @@
{ {
programs.nixvim.plugins = { programs.nixvim.plugins = {
clangd-extensions.enable = true;
crates-nvim.enable = true;
lsp-format = { lsp-format = {
enable = true; enable = true;
}; };

View File

@ -6,6 +6,7 @@
settings = { settings = {
updateInInsert = false; updateInInsert = false;
}; };
sources = { sources = {
code_actions = { code_actions = {
gitsigns.enable = true; gitsigns.enable = true;