Fix gitui custom terminal

This commit is contained in:
Tyler Hallada 2023-12-01 15:26:00 -05:00
parent 764b24f100
commit 734aebfa00

View File

@ -1,16 +1,5 @@
local cl = vim.o.columns
local ln = vim.o.lines
local width = 0.8
local height = 0.8
require("toggleterm").setup({ require("toggleterm").setup({
direction = "horizontal", direction = "horizontal",
float_opts = {
border = "curved",
width = math.ceil(cl * width),
height = math.ceil(ln * height - 4),
winblend = 3,
},
open_mapping = [[<C-\>]], open_mapping = [[<C-\>]],
hide_numbers = true, hide_numbers = true,
-- shell = 'fish', -- shell = 'fish',
@ -33,14 +22,19 @@ vim.keymap.set('t', '<C-l>', [[<Cmd>wincmd l<CR>]])
-- Custom gitui terminal -- Custom gitui terminal
local Terminal = require('toggleterm.terminal').Terminal local Terminal = require('toggleterm.terminal').Terminal
local gitui = Terminal:new({ local gitui = Terminal:new({
cmd = 'gitui', cmd = 'gitui',
direction = 'float', direction = 'float',
hidden = true, float_opts = {
border = "curved",
width = function() return math.ceil(vim.o.columns * 0.8) end,
height = function() return math.ceil(vim.o.lines * 0.8) end,
winblend = 3,
},
hidden = true,
}) })
function _gitui_toggle() function _gitui_toggle()
gitui:toggle() gitui:toggle()
end end
vim.api.nvim_set_keymap("n", "<leader>G", "<cmd>lua _gitui_toggle()<CR>", { noremap = true, silent = true }) vim.keymap.set('n', '<leader>G', '<cmd>lua _gitui_toggle()<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap("t", "<leader>G", "<cmd>lua _gitui_toggle()<CR>", { noremap = true, silent = true })