mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-27 11:08:53 +02:00
plugins/completion: move to by-name
- Move nvim-cmp to plugins/cmp - Move other completion plugins to plugins/by-name
This commit is contained in:
parent
3211a63306
commit
ad85cd760e
36 changed files with 2 additions and 9 deletions
39
tests/test-sources/plugins/cmp/all-sources.nix
Normal file
39
tests/test-sources/plugins/cmp/all-sources.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
all-sources =
|
||||
{ config, ... }:
|
||||
{
|
||||
plugins = {
|
||||
copilot-lua = {
|
||||
enable = true;
|
||||
|
||||
panel.enabled = false;
|
||||
suggestion.enabled = false;
|
||||
};
|
||||
|
||||
cmp = {
|
||||
enable = true;
|
||||
settings.sources =
|
||||
with pkgs.lib;
|
||||
let
|
||||
disabledSources = [
|
||||
# We do not provide the required HF_API_KEY environment variable.
|
||||
"cmp_ai"
|
||||
# Triggers the warning complaining about treesitter highlighting being disabled
|
||||
"otter"
|
||||
] ++ optional (pkgs.stdenv.hostPlatform.system == "aarch64-linux") "cmp_tabnine";
|
||||
in
|
||||
pipe config.cmpSourcePlugins [
|
||||
# All known source names
|
||||
attrNames
|
||||
# Filter out disabled sources
|
||||
(filter (name: !(elem name disabledSources)))
|
||||
# Convert names to source attributes
|
||||
(map (name: {
|
||||
inherit name;
|
||||
}))
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue