File tree Expand file tree Collapse file tree 11 files changed +25
-74
lines changed
Expand file tree Collapse file tree 11 files changed +25
-74
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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 :
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" ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11{
22 imports = [
3- ./config.nix
4- ./options.nix
5-
63 ./nvim-cmp
74 ./blink-cmp
85 ] ;
Original file line number Diff line number Diff line change 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"
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]" ;
Original file line number Diff line number Diff line change 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}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2323in {
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
Original file line number Diff line number Diff line change 77 inherit ( lib . types ) bool str nullOr ;
88 inherit ( lib . modules ) mkRenamedOptionModule ;
99 inherit ( lib . nvim . types ) mkPluginSetupOption ;
10+
11+ completionCfg = config . vim . autocomplete ;
1012in {
1113 imports = let
1214 renamedSetupOption = oldPath : newPath :
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 } ;
Original file line number Diff line number Diff line change 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 } ;
You can’t perform that action at this time.
0 commit comments