From 764b24f100301c9681c763f09f2c2d6ca8c1ae8c Mon Sep 17 00:00:00 2001 From: Tyler Hallada Date: Fri, 1 Dec 2023 15:26:00 -0500 Subject: [PATCH] Add gitui custom toggleterm --- lua/plugins/toggleterm-nvim.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lua/plugins/toggleterm-nvim.lua b/lua/plugins/toggleterm-nvim.lua index a8dc29d..18f4be3 100644 --- a/lua/plugins/toggleterm-nvim.lua +++ b/lua/plugins/toggleterm-nvim.lua @@ -29,3 +29,18 @@ vim.keymap.set('t', '', [[wincmd l]]) -- vim.keymap.set('n', '', [[ToggleTerm]], { noremap = true, silent = true }) -- vim.keymap.set('t', '', [[ToggleTerm]], { noremap = true, silent = true }) + +-- Custom gitui terminal +local Terminal = require('toggleterm.terminal').Terminal +local gitui = Terminal:new({ + cmd = 'gitui', + direction = 'float', + hidden = true, +}) + +function _gitui_toggle() + gitui:toggle() +end + +vim.api.nvim_set_keymap("n", "G", "lua _gitui_toggle()", { noremap = true, silent = true }) +vim.api.nvim_set_keymap("t", "G", "lua _gitui_toggle()", { noremap = true, silent = true })