From 009038a365a21614e79eea8111bc82859f0addbd Mon Sep 17 00:00:00 2001 From: Tyler Hallada Date: Fri, 14 Oct 2022 23:03:27 +0000 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 })