toggleterm: use new keybind helper

This commit is contained in:
Ching Pei Yang 2024-11-17 20:19:07 +01:00
parent 458c0f6ed5
commit e697d71ebe
No known key found for this signature in database
GPG key ID: B3841364253DC4C8

View file

@ -7,7 +7,7 @@
inherit (lib.lists) optional; inherit (lib.lists) optional;
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.meta) getExe; inherit (lib.meta) getExe;
inherit (lib.nvim.binds) mkLznBinding; inherit (lib.nvim.binds) mkKeymap;
inherit (lib.nvim.lua) toLuaObject; inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.terminal.toggleterm; cfg = config.vim.terminal.toggleterm;
@ -19,7 +19,7 @@ in {
package = "toggleterm-nvim"; package = "toggleterm-nvim";
cmd = ["ToggleTerm" "ToggleTermSendCurrentLine" "ToggleTermSendVisualLines" "ToggleTermSendVisualSelection" "ToggleTermSetName" "ToggleTermToggleAll"]; cmd = ["ToggleTerm" "ToggleTermSendCurrentLine" "ToggleTermSendVisualLines" "ToggleTermSendVisualSelection" "ToggleTermSetName" "ToggleTermToggleAll"];
keys = keys =
[(mkLznBinding ["n"] cfg.mappings.open "<Cmd>execute v:count . \"ToggleTerm\"<CR>" "Toggle terminal")] [(mkKeymap "n" cfg.mappings.open "<Cmd>execute v:count . \"ToggleTerm\"<CR>" {desc = "Toggle terminal";})]
++ optional cfg.lazygit.enable { ++ optional cfg.lazygit.enable {
key = cfg.lazygit.mappings.open; key = cfg.lazygit.mappings.open;
mode = "n"; mode = "n";