2023-01-25 00:03:26 +00:00
|
|
|
{ pkgs, config, lib, ... }:
|
2021-12-23 21:51:56 +01:00
|
|
|
with lib;
|
2023-01-21 18:12:09 +01:00
|
|
|
let
|
2022-09-18 11:19:23 +01:00
|
|
|
cfg = config.plugins.telescope.extensions.fzf-native;
|
2021-12-23 21:51:56 +01:00
|
|
|
in
|
|
|
|
{
|
2022-09-18 11:19:23 +01:00
|
|
|
options.plugins.telescope.extensions.fzf-native = {
|
2021-12-23 21:51:56 +01:00
|
|
|
enable = mkEnableOption "Enable fzf-native";
|
|
|
|
|
2023-01-25 00:03:26 +00:00
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
|
|
|
default = pkgs.vimPlugins.telescope-fzf-native-nvim;
|
|
|
|
description = "Plugin to use for telescope extension fzf-native";
|
|
|
|
};
|
2023-01-19 10:45:15 +00:00
|
|
|
|
2021-12-23 21:51:56 +01:00
|
|
|
fuzzy = mkOption {
|
|
|
|
type = types.nullOr types.bool;
|
|
|
|
description = "Whether to fuzzy search. False will do exact matching";
|
|
|
|
default = null;
|
|
|
|
};
|
|
|
|
overrideGenericSorter = mkOption {
|
|
|
|
type = types.nullOr types.bool;
|
|
|
|
description = "Override the generice sorter";
|
|
|
|
default = null;
|
|
|
|
};
|
|
|
|
overrideFileSorter = mkOption {
|
|
|
|
type = types.nullOr types.bool;
|
|
|
|
description = "Override the file sorter";
|
|
|
|
default = null;
|
|
|
|
};
|
|
|
|
caseMode = mkOption {
|
|
|
|
type = types.nullOr (types.enum [ "smart_case" "ignore_case" "respect_case" ]);
|
|
|
|
default = null;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-01-21 18:12:09 +01:00
|
|
|
config = let
|
2021-12-23 21:51:56 +01:00
|
|
|
configuration = {
|
|
|
|
fuzzy = cfg.fuzzy;
|
|
|
|
override_generic_sorter = cfg.overrideGenericSorter;
|
|
|
|
override_file_sorter = cfg.overrideFileSorter;
|
|
|
|
case_mode = cfg.caseMode;
|
|
|
|
};
|
|
|
|
in mkIf cfg.enable {
|
2023-01-19 10:45:15 +00:00
|
|
|
extraPlugins = [ cfg.package ];
|
2021-12-23 21:51:56 +01:00
|
|
|
|
2022-09-18 11:19:23 +01:00
|
|
|
plugins.telescope.enabledExtensions = [ "fzf" ];
|
|
|
|
plugins.telescope.extensionConfig."fzf" = configuration;
|
2021-12-23 21:51:56 +01:00
|
|
|
};
|
|
|
|
}
|