From 433673a7b8b439b77a35ca4db53becdd1a0d0c7d Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Sun, 1 Sep 2024 00:24:33 -0500 Subject: [PATCH] plugins/cmp: add description to elevate autoEnableSource info --- plugins/completion/cmp/default.nix | 40 ++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/plugins/completion/cmp/default.nix b/plugins/completion/cmp/default.nix index 45aa74e142..0f1d43522c 100644 --- a/plugins/completion/cmp/default.nix +++ b/plugins/completion/cmp/default.nix @@ -16,6 +16,46 @@ helpers.neovim-plugin.mkNeovimPlugin config { maintainers = [ maintainers.GaetanLepage ]; + description = '' + ### Completion Source Installation + + If `plugins.cmp.autoEnableSources` is `true` Nixivm will automatically enable the corresponding source + plugins. This is the default behavior, but will work only when this option is set to a list. + + If you use a raw lua string or set `plugins.cmp.autoEnableSources` to `false`, you will need to explicitly enable the relevant source plugins in + your nixvim configuration. + + #### With auto-enabled sources + ```nix + plugins.cmp = { + autoEnableSources = true; + settings.sources = [ + { name = "nvim_lsp"; } + { name = "path"; } + { name = "buffer"; } + ]; + }; + ``` + + #### Without auto-enabled sources + ```nix + plugins = { + cmp = { + autoEnableSources = false; + settings.sources = [ + { name = "nvim_lsp"; } + { name = "path"; } + { name = "buffer"; } + ]; + }; + cmp-nvim-lsp.enable = true; + cmp-path.enable = true; + cmp-buffer.enable = true; + }; + + ``` + ''; + imports = [ # Introduced on 2024 February 21 # TODO: remove ~June 2024