mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-12-26 20:52:22 +00:00
run-nvim: fix keymaps
Some checks are pending
Check for typos in the source tree / check-typos (push) Waiting to run
Some checks are pending
Check for typos in the source tree / check-typos (push) Waiting to run
This commit is contained in:
parent
ce21e1f98a
commit
88834cc93f
1 changed files with 13 additions and 11 deletions
|
@ -5,11 +5,10 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf mkDefault;
|
inherit (lib.modules) mkIf mkDefault;
|
||||||
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetLznBinding mkSetLuaLznBinding;
|
inherit (lib.nvim.binds) mkKeymap;
|
||||||
|
|
||||||
cfg = config.vim.runner.run-nvim;
|
cfg = config.vim.runner.run-nvim;
|
||||||
mappingDefinitions = options.vim.runner.run-nvim.mappings;
|
inherit (options.vim.runner.run-nvim) mappings;
|
||||||
mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions;
|
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim = {
|
vim = {
|
||||||
|
@ -21,14 +20,17 @@ in {
|
||||||
cmd = "Run";
|
cmd = "Run";
|
||||||
|
|
||||||
keys = [
|
keys = [
|
||||||
(mkSetLznBinding "n" mappings.run "<cmd>Run<CR>")
|
(mkKeymap "n" cfg.mappings.run "<cmd>Run<CR>" {desc = mappings.run.description;})
|
||||||
(mkSetLznBinding "n" mappings.runOverride "<cmd>Run!<CR>")
|
(mkKeymap "n" cfg.mappings.runOverride "<cmd>Run!<CR>" {desc = mappings.runOverride.description;})
|
||||||
(mkSetLuaLznBinding "n" mappings.runCommand ''
|
(mkKeymap "n" cfg.mappings.runCommand ''
|
||||||
function()
|
function()
|
||||||
local input = vim.fn.input("Run command: ")
|
local input = vim.fn.input("Run command: ")
|
||||||
if input ~= "" then require("run").run(input, false) end
|
if input ~= "" then require("run").run(input, false) end
|
||||||
end
|
end
|
||||||
'')
|
'' {
|
||||||
|
desc = mappings.run.description;
|
||||||
|
lua = true;
|
||||||
|
})
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue