mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-26 15:06:45 +00:00
feat: add lazygit keybindings
This commit is contained in:
parent
933fa2a8ae
commit
c6c04f0d1b
2 changed files with 6 additions and 4 deletions
|
@ -6,7 +6,6 @@
|
||||||
with lib;
|
with lib;
|
||||||
with builtins; let
|
with builtins; let
|
||||||
cfg = config.vim.terminal.toggleterm;
|
cfg = config.vim.terminal.toggleterm;
|
||||||
toggleKey = "<c-t>";
|
|
||||||
in {
|
in {
|
||||||
config = mkMerge [
|
config = mkMerge [
|
||||||
(
|
(
|
||||||
|
@ -57,11 +56,10 @@ in {
|
||||||
hidden = true,
|
hidden = true,
|
||||||
on_open = function(term)
|
on_open = function(term)
|
||||||
vim.cmd("startinsert!")
|
vim.cmd("startinsert!")
|
||||||
vim.keymap.set( 't', [[${toggleKey}]], function() term:toggle() end, {silent = true, noremap = true, buffer = term.bufnr})
|
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.keymap.set( 'n', [[<leader>gg]], function() lazygit:toggle() end, {silent = true, noremap = true})
|
vim.keymap.set('n', ${toJSON cfg.lazygit.mappings.open}, function() lazygit:toggle() end, {silent = true, noremap = true, desc = 'Open lazygit [toggleterm]'})
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
@ -37,6 +37,10 @@ with builtins; {
|
||||||
default = pkgs.lazygit;
|
default = pkgs.lazygit;
|
||||||
description = "The package that should be used for lazygit. Setting it to null will attempt to use lazygit from your PATH";
|
description = "The package that should be used for lazygit. Setting it to null will attempt to use lazygit from your PATH";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mappings = {
|
||||||
|
open = mkMappingOption "Open lazygit [toggleterm]" "<leader>gg";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue