Skip to content

Commit c04abc9

Browse files
committed
treewide: revert shared cmp source option
1 parent 01f011f commit c04abc9

File tree

11 files changed

+25
-74
lines changed

11 files changed

+25
-74
lines changed

modules/plugins/assistant/copilot/config.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ in {
5858
};
5959
};
6060

61-
autocomplete = {
62-
nvim-cmp.sources = {copilot = "[Copilot]";};
61+
autocomplete.nvim-cmp = {
62+
sources = {copilot = "[Copilot]";};
6363
sourcePlugins = ["copilot-cmp"];
6464
};
6565

modules/plugins/completion/blink-cmp/config.nix

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
inherit (builtins) concatStringsSep typeOf tryEval attrNames mapAttrs;
1111

1212
cfg = config.vim.autocomplete.blink-cmp;
13-
autocompleteCfg = config.vim.autocomplete;
13+
cmpCfg = config.vim.autocomplete.nvim-cmp;
1414
inherit (cfg) mappings;
1515

1616
getPluginName = plugin:
@@ -36,23 +36,21 @@ in {
3636
${optionalString config.vim.lazy.enable
3737
(concatStringsSep "\n" (map
3838
(package: "require('lz.n').trigger_load(${toLuaObject (getPluginName package)})")
39-
autocompleteCfg.sourcePlugins))}
39+
cmpCfg.sourcePlugins))}
4040
'';
4141
};
4242
};
4343

4444
autocomplete = {
45-
enableSharedCmpSources = true;
46-
4745
blink-cmp.setupOpts = {
4846
sources = {
49-
default = ["lsp" "path" "snippets" "buffer"] ++ (attrNames autocompleteCfg.nvim-cmp.sources);
47+
default = ["lsp" "path" "snippets" "buffer"] ++ (attrNames cmpCfg.sources);
5048
providers =
5149
mapAttrs (name: _: {
5250
inherit name;
5351
module = "blink.compat.source";
5452
})
55-
autocompleteCfg.nvim-cmp.sources;
53+
cmpCfg.sources;
5654
};
5755
snippets = mkIf config.vim.snippets.luasnip.enable {
5856
preset = "luasnip";

modules/plugins/completion/config.nix

Lines changed: 0 additions & 34 deletions
This file was deleted.

modules/plugins/completion/default.nix

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{
22
imports = [
3-
./config.nix
4-
./options.nix
5-
63
./nvim-cmp
74
./blink-cmp
85
];

modules/plugins/completion/nvim-cmp/config.nix

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
borders = config.vim.ui.borders.plugins.nvim-cmp;
1313

1414
cfg = config.vim.autocomplete.nvim-cmp;
15-
autocompleteCfg = config.vim.autocomplete;
1615
luasnipEnable = config.vim.snippets.luasnip.enable;
1716
getPluginName = plugin:
1817
if typeOf plugin == "string"
@@ -49,18 +48,16 @@ in {
4948
${optionalString config.vim.lazy.enable
5049
(concatStringsSep "\n" (map
5150
(package: "require('lz.n').trigger_load(${toLuaObject (getPluginName package)})")
52-
autocompleteCfg.sourcePlugins))}
51+
cfg.sourcePlugins))}
5352
'';
5453

5554
event = ["InsertEnter" "CmdlineEnter"];
5655
};
5756
};
5857

5958
autocomplete = {
60-
enableSharedCmpSources = true;
61-
sourcePlugins = ["cmp-buffer" "cmp-path"];
62-
6359
nvim-cmp = {
60+
sourcePlugins = ["cmp-buffer" "cmp-path"];
6461
sources = {
6562
nvim-cmp = null;
6663
buffer = "[Buffer]";

modules/plugins/completion/nvim-cmp/nvim-cmp.nix

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
...
55
}: let
66
inherit (lib.options) mkEnableOption mkOption literalExpression literalMD;
7-
inherit (lib.types) str attrsOf nullOr either;
7+
inherit (lib.types) str attrsOf nullOr either listOf;
88
inherit (lib.generators) mkLuaInline;
99
inherit (lib.nvim.binds) mkMappingOption;
10-
inherit (lib.nvim.types) mkPluginSetupOption luaInline mergelessListOf;
10+
inherit (lib.nvim.types) mkPluginSetupOption luaInline mergelessListOf pluginType;
1111
inherit (lib.nvim.lua) toLuaObject;
1212
inherit (builtins) isString;
1313

@@ -107,5 +107,11 @@ in {
107107
}
108108
'';
109109
};
110+
111+
sourcePlugins = mkOption {
112+
type = listOf pluginType;
113+
default = [];
114+
description = "List of source plugins used by nvim-cmp.";
115+
};
110116
};
111117
}

modules/plugins/completion/options.nix

Lines changed: 0 additions & 15 deletions
This file was deleted.

modules/plugins/lsp/config.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
in {
2424
config = mkIf cfg.enable {
2525
vim = {
26-
autocomplete = mkIf usingNvimCmp {
27-
nvim-cmp.sources = {nvim_lsp = "[LSP]";};
26+
autocomplete.nvim-cmp = mkIf usingNvimCmp {
27+
sources = {nvim_lsp = "[LSP]";};
2828
sourcePlugins = ["cmp-nvim-lsp"];
2929
};
3030

modules/plugins/notes/obsidian/obsidian.nix

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
inherit (lib.types) bool str nullOr;
88
inherit (lib.modules) mkRenamedOptionModule;
99
inherit (lib.nvim.types) mkPluginSetupOption;
10+
11+
completionCfg = config.vim.autocomplete;
1012
in {
1113
imports = let
1214
renamedSetupOption = oldPath: newPath:
@@ -42,7 +44,7 @@ in {
4244
# If using nvim-cmp, otherwise set to false
4345
type = bool;
4446
description = "If using nvim-cmp, otherwise set to false";
45-
default = config.vim.autocomplete.enableSharedCmpSources;
47+
default = completionCfg.nvim-cmp.enable || completionCfg.blink-cmp.enable;
4648
};
4749
};
4850
};

modules/plugins/snippets/luasnip/config.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ in {
1717
};
1818
};
1919
startPlugins = cfg.providers;
20-
autocomplete = mkIf config.vim.autocomplete.nvim-cmp.enable {
21-
nvim-cmp.sources = {luasnip = "[LuaSnip]";};
20+
autocomplete.nvim-cmp = mkIf config.vim.autocomplete.nvim-cmp.enable {
21+
sources = {luasnip = "[LuaSnip]";};
2222
sourcePlugins = ["cmp-luasnip"];
2323
};
2424
};

0 commit comments

Comments
 (0)