nix-community.nixvim/plugins/by-name/blink-cmp/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

62 lines
1.5 KiB
Nix
Raw Permalink Normal View History

2024-10-10 23:39:56 +03:00
{
lib,
...
}:
2024-12-22 09:58:27 +00:00
lib.nixvim.plugins.mkNeovimPlugin {
2024-10-10 23:39:56 +03:00
name = "blink-cmp";
packPathName = "blink.cmp";
2024-10-10 23:39:56 +03:00
package = "blink-cmp";
maintainers = with lib.maintainers; [
balssh
khaneliman
];
2024-10-10 23:39:56 +03:00
description = ''
Performant, batteries-included completion plugin for Neovim.
'';
2024-12-30 23:55:58 +01:00
settingsOptions = import ./settings-options.nix lib;
2024-10-10 23:39:56 +03:00
2024-12-30 23:55:58 +01:00
settingsExample = {
keymap.preset = "super-tab";
sources = {
providers = {
buffer.score_offset = -7;
lsp.fallbacks = [ ];
2024-10-10 23:39:56 +03:00
};
2024-12-30 23:55:58 +01:00
cmdline = [ ];
};
completion = {
accept = {
auto_brackets = {
enabled = true;
semantic_token_resolution.enabled = false;
};
2024-10-10 23:39:56 +03:00
};
2024-12-30 23:55:58 +01:00
documentation.auto_show = true;
2024-10-10 23:39:56 +03:00
};
2024-12-30 23:55:58 +01:00
appearance = {
2024-10-10 23:39:56 +03:00
use_nvim_cmp_as_default = true;
2024-12-30 23:55:58 +01:00
nerd_font_variant = "normal";
2024-10-10 23:39:56 +03:00
};
2024-12-30 23:55:58 +01:00
signature.enabled = true;
2024-10-10 23:39:56 +03:00
};
extraOptions = {
setupLspCapabilities = lib.nixvim.options.mkEnabledOption "LSP capabilities for blink-cmp";
};
extraConfig = cfg: {
# TODO: On Neovim 0.11+ and Blink.cmp 0.10+ with vim.lsp.config, you may skip this step.
# This is still required when using nvim-lspconfig, until this issue is completed:
# https://github.com/neovim/nvim-lspconfig/issues/3494
plugins.lsp.capabilities =
lib.mkIf cfg.setupLspCapabilities # lua
''
-- Capabilities configuration for blink-cmp
capabilities = require("blink-cmp").get_lsp_capabilities(capabilities)
'';
};
2024-10-10 23:39:56 +03:00
}