Skip to content

Commit

Permalink
fixup! toggleterm: lazy load
Browse files Browse the repository at this point in the history
  • Loading branch information
horriblename committed Oct 6, 2024
1 parent 9a56cc3 commit d5b5c52
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modules/plugins/terminal/toggleterm/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
inherit (lib.nvim.binds) mkLznBinding;

cfg = config.vim.terminal.toggleterm;
lazygitMapDesc = "Open lazygit [toggleterm]";
in {
config = mkIf cfg.enable {
vim = {
Expand All @@ -19,7 +20,10 @@ in {
cmd = ["ToggleTerm" "ToggleTermSendCurrentLine" "ToggleTermSendVisualLines" "ToggleTermSendVisualSelection" "ToggleTermSetName" "ToggleTermToggleAll"];
keys = [
(mkLznBinding ["n"] cfg.mappings.open "<Cmd>execute v:count . \"ToggleTerm\"<CR>" "Toggle terminal")
{key = cfg.lazygit.mappings.open;}
{
key = cfg.lazygit.mappings.open;
desc = lazygitMapDesc;
}
];

setupModule = "toggleterm";
Expand All @@ -39,7 +43,7 @@ in {
end
})
vim.keymap.set('n', ${toJSON cfg.lazygit.mappings.open}, function() lazygit:toggle() end, {silent = true, noremap = true, desc = 'Open lazygit [toggleterm]'})
vim.keymap.set('n', ${toJSON cfg.lazygit.mappings.open}, function() lazygit:toggle() end, {silent = true, noremap = true, desc = '${lazygitMapDesc}'})
'';
}
];
Expand Down

0 comments on commit d5b5c52

Please sign in to comment.