2023-02-27 14:52:43 +00:00
|
|
|
{
|
2023-04-17 20:27:27 +00:00
|
|
|
pkgs,
|
2023-02-27 14:52:43 +00:00
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib;
|
2023-04-17 20:27:27 +00:00
|
|
|
with builtins; let
|
|
|
|
cfg = config.vim.autocomplete;
|
|
|
|
builtSources =
|
|
|
|
concatMapStringsSep "\n" (x: "{ name = '${x}'},") cfg.sources;
|
|
|
|
in {
|
2023-02-27 14:52:43 +00:00
|
|
|
options.vim = {
|
|
|
|
autocomplete = {
|
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
2023-04-17 20:27:27 +00:00
|
|
|
description = "enable autocomplete";
|
2023-02-27 14:52:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
type = mkOption {
|
|
|
|
type = types.enum ["nvim-cmp"];
|
|
|
|
default = "nvim-cmp";
|
|
|
|
description = "Set the autocomplete plugin. Options: [nvim-cmp]";
|
|
|
|
};
|
2023-04-17 20:27:27 +00:00
|
|
|
|
|
|
|
sources = mkOption {
|
|
|
|
description = "List of source names for nvim-cmp";
|
|
|
|
type = with types; listOf str;
|
|
|
|
default = [];
|
|
|
|
};
|
2023-02-27 14:52:43 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|