From 88834cc93fa543e7b2cd3cf49b72870bc6544197 Mon Sep 17 00:00:00 2001 From: diniamo Date: Tue, 3 Dec 2024 16:28:31 +0100 Subject: [PATCH] run-nvim: fix keymaps --- modules/plugins/runner/run-nvim/config.nix | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/modules/plugins/runner/run-nvim/config.nix b/modules/plugins/runner/run-nvim/config.nix index 70cd5c9f..7667f5d0 100644 --- a/modules/plugins/runner/run-nvim/config.nix +++ b/modules/plugins/runner/run-nvim/config.nix @@ -5,11 +5,10 @@ ... }: let inherit (lib.modules) mkIf mkDefault; - inherit (lib.nvim.binds) addDescriptionsToMappings mkSetLznBinding mkSetLuaLznBinding; + inherit (lib.nvim.binds) mkKeymap; cfg = config.vim.runner.run-nvim; - mappingDefinitions = options.vim.runner.run-nvim.mappings; - mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions; + inherit (options.vim.runner.run-nvim) mappings; in { config = mkIf cfg.enable { vim = { @@ -21,14 +20,17 @@ in { cmd = "Run"; keys = [ - (mkSetLznBinding "n" mappings.run "Run") - (mkSetLznBinding "n" mappings.runOverride "Run!") - (mkSetLuaLznBinding "n" mappings.runCommand '' - function() - local input = vim.fn.input("Run command: ") - if input ~= "" then require("run").run(input, false) end - end - '') + (mkKeymap "n" cfg.mappings.run "Run" {desc = mappings.run.description;}) + (mkKeymap "n" cfg.mappings.runOverride "Run!" {desc = mappings.runOverride.description;}) + (mkKeymap "n" cfg.mappings.runCommand '' + function() + local input = vim.fn.input("Run command: ") + if input ~= "" then require("run").run(input, false) end + end + '' { + desc = mappings.run.description; + lua = true; + }) ]; };