70 lines
1.9 KiB
Nix
70 lines
1.9 KiB
Nix
{
|
|
lib,
|
|
config,
|
|
...
|
|
}: let
|
|
lazydevEnabled = config.home-manager.users.moritz.programs.nixvim.plugins.lazydev.enable;
|
|
in {
|
|
home-manager.users.moritz.programs.nixvim = {
|
|
plugins.blink-compat.enable = true;
|
|
plugins.blink-ripgrep.enable = true;
|
|
plugins.lsp.capabilities =
|
|
/*
|
|
lua
|
|
*/
|
|
''
|
|
capabilities = require('blink.cmp').get_lsp_capabilities(capabilities)
|
|
'';
|
|
plugins.blink-cmp = {
|
|
enable = true;
|
|
settings = {
|
|
keymap = {
|
|
preset = "default";
|
|
};
|
|
appearance.nerd_font_variant = "mono";
|
|
sources = {
|
|
default =
|
|
[
|
|
"lsp"
|
|
"path"
|
|
"snippets"
|
|
"buffer"
|
|
"vimtex"
|
|
"ripgrep"
|
|
]
|
|
++ lib.optional lazydevEnabled "lazydev";
|
|
providers = {
|
|
vimtex = {
|
|
name = "vimtex";
|
|
module = "blink.compat.source";
|
|
};
|
|
ripgrep = {
|
|
module = "blink-ripgrep";
|
|
name = "Ripgrep";
|
|
transform_items.__raw = ''
|
|
function(_, items)
|
|
for _, item in ipairs(items) do
|
|
-- example: append a description to easily distinguish rg results
|
|
item.labelDetails = {
|
|
description = "(rg)",
|
|
}
|
|
end
|
|
return items
|
|
end'';
|
|
};
|
|
lazydev = lib.mkIf lazydevEnabled {
|
|
name = "LazyDev";
|
|
module = "lazydev.integrations.blink";
|
|
# make lazydev completions top priority (see `:h blink.cmp`)
|
|
score_offset = 100;
|
|
};
|
|
};
|
|
};
|
|
signature.enabled = true;
|
|
completion.documentation.auto_show = true;
|
|
completion.accept.auto_brackets.enabled = true;
|
|
snippets.preset = "luasnip";
|
|
};
|
|
};
|
|
};
|
|
}
|