diff --git a/configs/nixvim/fiesta/modules/setups/completion.nix b/configs/nixvim/fiesta/modules/setups/completion.nix index 4377a716..ba59595c 100644 --- a/configs/nixvim/fiesta/modules/setups/completion.nix +++ b/configs/nixvim/fiesta/modules/setups/completion.nix @@ -10,51 +10,26 @@ in config = lib.mkIf cfg.enable (lib.mkMerge [ { - plugins.nvim-cmp = { + plugins.cmp = { enable = true; autoEnableSources = true; - mapping = { + settings.mapping = { "" = "cmp.mapping.confirm({ select = true })"; "" = "cmp.mapping.complete()"; "" = "cmp.mapping.scroll_docs(-4)"; "" = "cmp.mapping.scroll_docs(4)"; "" = "cmp.mapping.close()"; - - "" = { - action = "cmp.mapping.select_next_item()"; - modes = [ "i" "s" ]; - }; - "" = { - action = "cmp.mapping.select_prev_item()"; - modes = [ "i" "s" ]; - }; - - "" = { - action = "cmp.mapping.select_next_item()"; - modes = [ "i" "s" ]; - }; - "" = { - action = "cmp.mapping.select_prev_item()"; - modes = [ "i" "s" ]; - }; + "" = "cmp.mapping.select_next_item()"; + "" = "cmp.mapping.select_prev_item()"; + "" = "cmp.mapping.select_next_item()"; + "" = "cmp.mapping.select_prev_item()"; }; - sources = [ - { - name = "nvim_lsp"; - groupIndex = 1; - } - - { - name = "path"; - groupIndex = 3; - } - - { - name = "buffer"; - groupIndex = 4; - } + settings.sources = [ + { name = "nvim_lsp"; } + { name = "path"; } + { name = "buffer"; } ]; }; @@ -70,16 +45,15 @@ in }) (lib.mkIf nixvimCfg.setups.snippets.enable { - plugins.nvim-cmp.extraOptions.snippet.expand = helpers.mkRaw '' - function(args) - require('luasnip').lsp_expand(args.body) - end - ''; + plugins.cmp.settings = { + snippet.expand = '' + function(args) + require('luasnip').lsp_expand(args.body) + end + ''; - plugins.nvim-cmp.sources = [{ - name = "luasnip"; - groupIndex = 2; - }]; + sources = [{ name = "luasnip"; }]; + }; plugins.cmp_luasnip.enable = true; })