mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-01 19:11:15 +00:00
use separate dag for toggleterm
This commit is contained in:
parent
24b631f343
commit
f8ff3cd9fa
1 changed files with 45 additions and 38 deletions
|
@ -8,12 +8,13 @@ with builtins; let
|
|||
cfg = config.vim.terminal.toggleterm;
|
||||
toggleKey = "<c-t>";
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
config = mkMerge [
|
||||
(mkIf cfg.enable {
|
||||
vim.startPlugins = [
|
||||
"toggleterm-nvim"
|
||||
];
|
||||
|
||||
vim.luaConfigRC.toggleterm = nvim.dag.entryAnywhere (''
|
||||
vim.luaConfigRC.toggleterm = nvim.dag.entryAnywhere ''
|
||||
require("toggleterm").setup({
|
||||
open_mapping = [[${toggleKey}]],
|
||||
direction = '${toString cfg.direction}',
|
||||
|
@ -32,9 +33,13 @@ in {
|
|||
end
|
||||
},
|
||||
})
|
||||
''
|
||||
+ optionalString cfg.lazygit.enable ''
|
||||
|
||||
'';
|
||||
}
|
||||
)
|
||||
(
|
||||
mkIf (cfg.enable && cfg.lazygit.enable)
|
||||
{
|
||||
vim.luaConfigRC.toggleterm-lazygit = mkIf cfg.lazygit.enable nvim.dag.entryAfter ["toggleterm"] ''
|
||||
local terminal = require 'toggleterm.terminal'
|
||||
local lazygit = terminal.Terminal:new({
|
||||
cmd = "lazygit",
|
||||
|
@ -47,6 +52,8 @@ in {
|
|||
})
|
||||
|
||||
vim.keymap.set( 'n', [[<leader>gg]], function() lazygit:toggle() end, {silent = true, noremap = true})
|
||||
'');
|
||||
};
|
||||
'';
|
||||
}
|
||||
)
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue