blink: init

This commit is contained in:
Ching Pei Yang 2024-12-23 01:24:06 +01:00
parent 46aa168b2d
commit 402eba80b7
No known key found for this signature in database
GPG key ID: B3841364253DC4C8
5 changed files with 46 additions and 0 deletions

View file

@ -0,0 +1,16 @@
{lib, ...}: let
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.types) listOf string;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.autocomplete.blink-cmp = {
enable = mkEnableOption "blink.cmp";
setupOpts = mkPluginSetupOption "blink.cmp" {
sources = mkOption {
type = listOf string;
description = "List of sources to enable for completion.";
default = ["lsp" "path" "snippets" "buffer"];
};
};
};
}

View file

@ -0,0 +1,19 @@
{
lib,
config,
...
}: let
inherit (lib.modules) mkIf;
cfg = config.vim.autocomplete.blink-nvim;
in {
vim = mkIf cfg.enable {
lazy.plugins = [
{
package = "blink-cmp";
setupModule = "blink";
inherit (cfg) setupOpts;
event = ["InsertEnter" "CmdlineEnter"];
}
];
};
}

View file

@ -0,0 +1,3 @@
{
imports = [./blink-cmp.nix ./config.nix];
}

View file

@ -1,5 +1,6 @@
{
imports = [
./nvim-cmp
./blink-cmp
];
}

View file

@ -0,0 +1,7 @@
{lib, ...}: let
inherit (lib.options) mkEnableOption;
in {
options.vim.autocomplete = {
enableSharedCmpSources = mkEnableOption "cmp sources that can work in nvim-cmp and blink.cmp";
};
}