add lazygit toggleterm
This commit is contained in:
parent
1ff2f4e929
commit
bb01ab2e69
1 changed files with 23 additions and 0 deletions
|
|
@ -1,7 +1,18 @@
|
||||||
# homepage: https://github.com/akinsho/toggleterm.nvim
|
# homepage: https://github.com/akinsho/toggleterm.nvim
|
||||||
# nixvim doc: https://nix-community.github.io/nixvim/plugins/toggleterm/index.html
|
# nixvim doc: https://nix-community.github.io/nixvim/plugins/toggleterm/index.html
|
||||||
_:
|
_:
|
||||||
|
let
|
||||||
|
# https://github.com/AstroNvim/AstroNvim/blob/v4.7.7/lua/astronvim/plugins/toggleterm.lua#L14-L19
|
||||||
|
lazygit_exec = ''
|
||||||
|
function()
|
||||||
|
local worktree = require("astrocore").file_worktree()
|
||||||
|
local flags = worktree and (" --work-tree=%s --git-dir=%s"):format(worktree.toplevel, worktree.gitdir)
|
||||||
|
or ""
|
||||||
|
|
||||||
|
require("astrocore").toggle_term_cmd(table.concat({"lazygit", flags}))
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
in
|
||||||
{
|
{
|
||||||
opts = {
|
opts = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
@ -101,5 +112,17 @@ _:
|
||||||
action = "<cmd>TermSelect<cr>";
|
action = "<cmd>TermSelect<cr>";
|
||||||
options.desc = "List terminals";
|
options.desc = "List terminals";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<Leader>gg";
|
||||||
|
action.__raw = lazygit_exec;
|
||||||
|
options.desc = "ToggleTerm lazygit";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "n";
|
||||||
|
key = "<Leader>tl";
|
||||||
|
action.__raw = lazygit_exec;
|
||||||
|
options.desc = "ToggleTerm lazygit";
|
||||||
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue