toggleterm: make lazygit keybind optional

This commit is contained in:
Ching Pei Yang 2024-10-31 13:57:13 +01:00
parent 9360becd30
commit 7543cc2725
No known key found for this signature in database
GPG key ID: B3841364253DC4C8

View file

@ -5,6 +5,7 @@
}: let
inherit (builtins) toJSON;
inherit (lib.strings) optionalString;
inherit (lib.lists) optional;
inherit (lib.modules) mkIf;
inherit (lib.meta) getExe;
inherit (lib.nvim.binds) mkLznBinding;
@ -17,13 +18,12 @@ in {
lazy.plugins.toggleterm-nvim = {
package = "toggleterm-nvim";
cmd = ["ToggleTerm" "ToggleTermSendCurrentLine" "ToggleTermSendVisualLines" "ToggleTermSendVisualSelection" "ToggleTermSetName" "ToggleTermToggleAll"];
keys = [
(mkLznBinding ["n"] cfg.mappings.open "<Cmd>execute v:count . \"ToggleTerm\"<CR>" "Toggle terminal")
{
keys =
[(mkLznBinding ["n"] cfg.mappings.open "<Cmd>execute v:count . \"ToggleTerm\"<CR>" "Toggle terminal")]
++ optional cfg.lazygit.enable {
key = cfg.lazygit.mappings.open;
desc = lazygitMapDesc;
}
];
};
setupModule = "toggleterm";
inherit (cfg) setupOpts;