plugins: use mkMappingOption instead of mkOption where possible

This commit is contained in:
alfarel 2026-03-14 22:19:58 -04:00
commit 5e1ee37e7f
No known key found for this signature in database
9 changed files with 113 additions and 411 deletions

View file

@ -1,13 +1,15 @@
{
config,
pkgs,
lib,
...
}: let
inherit (lib.options) mkEnableOption mkOption literalExpression;
inherit (lib.generators) mkLuaInline;
inherit (lib.types) nullOr str bool int submodule listOf enum oneOf attrs addCheck;
inherit (lib.types) str bool int submodule listOf enum oneOf attrs addCheck;
inherit (lib.nvim.types) mkPluginSetupOption;
inherit (lib.nvim.config) batchRenameOptions;
inherit (config.vim.lib) mkMappingOption;
migrationTable = {
disableNetrw = "disable_netrw";
@ -76,26 +78,10 @@ in {
enable = mkEnableOption "filetree via nvim-tree.lua";
mappings = {
toggle = mkOption {
type = nullOr str;
default = "<leader>t";
description = "Toggle NvimTree";
};
refresh = mkOption {
type = nullOr str;
default = "<leader>tr";
description = "Refresh NvimTree";
};
findFile = mkOption {
type = nullOr str;
default = "<leader>tg";
description = "Find file in NvimTree";
};
focus = mkOption {
type = nullOr str;
default = "<leader>tf";
description = "Focus NvimTree";
};
toggle = mkMappingOption "Toggle NvimTree" "<leader>t";
refresh = mkMappingOption "Refresh NvimTree" "<leader>tr";
findFile = mkMappingOption "Find file in NvimTree" "<leader>tg";
focus = mkMappingOption "Focus NvimTree" "<leader>tf";
};
setupOpts = mkPluginSetupOption "Nvim Tree" {