diff --git a/plugins/cmp.nix b/plugins/cmp.nix new file mode 100644 index 0000000..2923df7 --- /dev/null +++ b/plugins/cmp.nix @@ -0,0 +1,36 @@ +_: +{ + opts = { + enable = true; + autoEnableSources = true; + settings = { + snippet.expand = ''function(args) require("luasnip").lsp_expand(args.body) end''; + + sources = [ + { name = "nvim_lsp"; priority = 1000; } + { name = "path"; priority = 250; } + { name = "buffer"; priority = 500; group_index = 2; } + ]; + + # TODO: add this at luasnip: + # { name = "luasnip", priority = 750 } + }; + }; + + rootOpts = { + keymaps = [ + { + mode = "n"; + key = "uc"; + action.__raw = ''require("astrocore.toggles").buffer_cmp''; + options.desc = "Toggle autocompletion (buffer)"; + } + { + mode = "n"; + key = "uC"; + action.__raw = ''require("astrocore.toggles").cmp''; + options.desc = "Toggle autocompletion (global)"; + } + ]; + }; +} diff --git a/plugins/precognition/default.nix b/plugins/precognition/default.nix index d45ad85..42936d8 100644 --- a/plugins/precognition/default.nix +++ b/plugins/precognition/default.nix @@ -17,7 +17,7 @@ rootOpts.keymaps = [ { mode = "n"; - key = "uc"; + key = "uP"; action.__raw = '' function() local visible = require("precognition").toggle()