mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2025-01-09 05:39:49 +01:00
blink: init
This commit is contained in:
parent
d14c5e57db
commit
16fc1a7de2
5 changed files with 46 additions and 0 deletions
16
modules/plugins/completion/blink-cmp/blink-cmp.nix
Normal file
16
modules/plugins/completion/blink-cmp/blink-cmp.nix
Normal 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"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
19
modules/plugins/completion/blink-cmp/config.nix
Normal file
19
modules/plugins/completion/blink-cmp/config.nix
Normal 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"];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
3
modules/plugins/completion/blink-cmp/default.nix
Normal file
3
modules/plugins/completion/blink-cmp/default.nix
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
imports = [./blink-cmp.nix ./config.nix];
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./nvim-cmp
|
./nvim-cmp
|
||||||
|
./blink-cmp
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
7
modules/plugins/completion/options.nix
Normal file
7
modules/plugins/completion/options.nix
Normal 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";
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue