From 11a80c1a80b16016ad03e703d1c9dea07f495cb7 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Wed, 5 Feb 2025 12:12:19 -0600 Subject: [PATCH] plugins/blink-cmp-dictionary: init --- .../by-name/blink-cmp-dictionary/default.nix | 50 +++++++++++++++++++ .../by-name/blink-cmp-dictionary/default.nix | 11 ++++ 2 files changed, 61 insertions(+) create mode 100644 plugins/by-name/blink-cmp-dictionary/default.nix create mode 100644 tests/test-sources/plugins/by-name/blink-cmp-dictionary/default.nix diff --git a/plugins/by-name/blink-cmp-dictionary/default.nix b/plugins/by-name/blink-cmp-dictionary/default.nix new file mode 100644 index 00000000..ec0b5232 --- /dev/null +++ b/plugins/by-name/blink-cmp-dictionary/default.nix @@ -0,0 +1,50 @@ +{ lib, ... }: +lib.nixvim.plugins.mkNeovimPlugin { + name = "blink-cmp-dictionary"; + package = "blink-cmp-dictionary"; + + maintainers = [ lib.maintainers.khaneliman ]; + + description = '' + This plugin should be configured through blink-cmp's `sources.providers` settings. + + For example: + + ```nix + plugins.blink-cmp = { + enable = true; + settings.sources.providers = { + dictionary = { + module = "blink-cmp-dictionary"; + name = "Dict"; + score_offset = 100; + min_keyword_length = 3; + # Optional configurations + opts = { + }; + }; + }; + }; + ``` + + And then you can add it to blink-cmp's `sources.default` option: + + ```nix + plugins.blink-cmp = { + enable = true; + settings.sources.default = [ + "lsp" + "path" + "luasnip" + "buffer" + "dictionary" + ]; + }; + ``` + ''; + + # Configured through blink-cmp + callSetup = false; + hasLuaConfig = false; + hasSettings = false; +} diff --git a/tests/test-sources/plugins/by-name/blink-cmp-dictionary/default.nix b/tests/test-sources/plugins/by-name/blink-cmp-dictionary/default.nix new file mode 100644 index 00000000..a0853b86 --- /dev/null +++ b/tests/test-sources/plugins/by-name/blink-cmp-dictionary/default.nix @@ -0,0 +1,11 @@ +{ + empty = { + plugins.blink-cmp-dictionary.enable = true; + }; + + defaults = { + plugins.blink-cmp-dictionary = { + enable = true; + }; + }; +}