nvf/modules/plugins/runner/run-nvim/config.nix

33 lines
820 B
Nix
Raw Normal View History

2024-11-21 21:03:28 +00:00
{
lib,
config,
options,
...
}: let
inherit (lib.modules) mkIf mkDefault;
2024-12-03 15:28:31 +00:00
inherit (lib.nvim.binds) mkKeymap;
2024-11-21 21:03:28 +00:00
cfg = config.vim.runner.run-nvim;
2024-12-03 15:28:31 +00:00
inherit (options.vim.runner.run-nvim) mappings;
2024-11-21 21:03:28 +00:00
in {
config = mkIf cfg.enable {
vim = {
lazy.plugins.run-nvim = {
package = "run-nvim";
setupModule = "run";
inherit (cfg) setupOpts;
cmd = "Run";
keys = [
2024-12-25 12:37:04 +00:00
(mkKeymap "n" cfg.mappings.run "<cmd>Run<cr>" {desc = mappings.run.description;})
(mkKeymap "n" cfg.mappings.runOverride "<cmd>Run!<cr>" {desc = mappings.runOverride.description;})
(mkKeymap "n" cfg.mappings.runCommand "<cmd>RunPrompt<cr>" {desc = mappings.run.description;})
2024-11-21 21:03:28 +00:00
];
};
binds.whichKey.register."<leader>r" = mkDefault "+Run";
};
};
}