diff --git a/modules/plugins/completion/blink-cmp/blink-cmp.nix b/modules/plugins/completion/blink-cmp/blink-cmp.nix index a2171552..f5e38ed1 100644 --- a/modules/plugins/completion/blink-cmp/blink-cmp.nix +++ b/modules/plugins/completion/blink-cmp/blink-cmp.nix @@ -1,6 +1,6 @@ {lib, ...}: let inherit (lib.options) mkEnableOption mkOption literalMD; - inherit (lib.types) listOf str either attrsOf submodule enum anything int nullOr; + inherit (lib.types) bool listOf str either attrsOf submodule enum anything int nullOr; inherit (lib.generators) mkLuaInline; inherit (lib.nvim.types) mkPluginSetupOption luaInline pluginType; inherit (lib.nvim.binds) mkMappingOption; @@ -64,6 +64,12 @@ in { default = []; description = "List of sources to enable for cmdline. Null means use default source list."; }; + + keymap = mkOption { + type = keymapType; + default = {}; + description = "blink.cmp cmdline keymap"; + }; }; completion = { @@ -75,6 +81,16 @@ in { description = "Delay before auto show triggers"; }; }; + + menu.auto_show = mkOption { + type = bool; + default = true; + description = '' + Manages the appearance of the completion menu. You may prevent the menu + from automatically showing by this option to `false` and manually showing + it with the show keymap command. + ''; + }; }; keymap = mkOption { @@ -104,7 +120,25 @@ in { fuzzy = { prebuilt_binaries = { download = mkBool false '' - Auto-downloads prebuilt binaries. Do not enable, it doesn't work on nix + Auto-downloads prebuilt binaries. + + ::: .{warning} + Do not enable this option, as it does **not work** on Nix! + ::: + ''; + }; + + implementation = mkOption { + type = enum ["lua" "prefer_rust" "rust" "prefer_rust_with_warning"]; + default = "prefer_rust"; + description = '' + fuzzy matcher implementation for Blink. + + * `"lua"`: slower, Lua native fuzzy matcher implementation + * `"rust": use the SIMD fuzzy matcher, 'frizbee' + * `"prefer_rust"`: use the rust implementation, but fall back to lua + * `"prefer_rust_with_warning"`: use the rust implementation, and fall back to lua + if it is not available after emitting a warning. ''; }; }; @@ -123,12 +157,14 @@ in { sourcePlugins = let sourcePluginType = submodule { options = { + enable = mkEnableOption "this source"; package = mkOption { type = pluginType; description = '' `blink-cmp` source plugin package. ''; }; + module = mkOption { type = str; description = '' @@ -137,7 +173,6 @@ in { Should be present in the source's documentation. ''; }; - enable = mkEnableOption "this source"; }; }; in