mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-12-19 06:29:47 +01: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 builtins; let
|
||||
cfg = config.vim.terminal.toggleterm;
|
||||
toggleKey = "<c-t>";
|
||||
in {
|
||||
config = mkMerge [
|
||||
(
|
||||
|
@ -14,7 +13,7 @@ in {
|
|||
vim.startPlugins = [
|
||||
"toggleterm-nvim"
|
||||
];
|
||||
|
||||
|
||||
vim.maps.normal = mkBinding cfg.mappings.open "<Cmd>execute v:count . \"ToggleTerm\"<CR>" "Toggle terminal";
|
||||
|
||||
vim.luaConfigRC.toggleterm = nvim.dag.entryAnywhere ''
|
||||
|
@ -57,11 +56,10 @@ in {
|
|||
hidden = true,
|
||||
on_open = function(term)
|
||||
vim.cmd("startinsert!")
|
||||
vim.keymap.set( 't', [[${toggleKey}]], function() term:toggle() end, {silent = true, noremap = true, buffer = term.bufnr})
|
||||
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;
|
||||
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