From 61be6cf4053537b1d0cf709b3283143e1f1b4b65 Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Mon, 5 May 2025 22:30:27 +0200 Subject: [PATCH] cmp: use normal priority for default values After this change, user configs should be "appended" to default ones instead of overriding them --- modules/plugins/completion/nvim-cmp/config.nix | 5 +++++ modules/plugins/completion/nvim-cmp/nvim-cmp.nix | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/plugins/completion/nvim-cmp/config.nix b/modules/plugins/completion/nvim-cmp/config.nix index 749ebb7c..cf27caaf 100644 --- a/modules/plugins/completion/nvim-cmp/config.nix +++ b/modules/plugins/completion/nvim-cmp/config.nix @@ -60,6 +60,11 @@ in { enableSharedCmpSources = true; nvim-cmp = { + sources = { + nvim-cmp = null; + buffer = "[Buffer]"; + path = "[Path]"; + }; sourcePlugins = ["cmp-buffer" "cmp-path"]; setupOpts = { diff --git a/modules/plugins/completion/nvim-cmp/nvim-cmp.nix b/modules/plugins/completion/nvim-cmp/nvim-cmp.nix index 2c8c77d3..8105ed00 100644 --- a/modules/plugins/completion/nvim-cmp/nvim-cmp.nix +++ b/modules/plugins/completion/nvim-cmp/nvim-cmp.nix @@ -98,11 +98,15 @@ in { sources = mkOption { type = attrsOf (nullOr str); - default = { + defaultText = literalMD '' + These sources are included by default: + + ```nix nvim-cmp = null; buffer = "[Buffer]"; path = "[Path]"; - }; + ``` + ''; example = { nvim-cmp = null; buffer = "[Buffer]";