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({
direction = "horizontal",
float_opts = {
border = "curved",
width = math.ceil(cl * width),
height = math.ceil(ln * height - 4),
winblend = 3,
},
open_mapping = [[<C-\>]],
hide_numbers = true,
-- shell = 'fish',
@ -35,6 +24,12 @@ local Terminal = require('toggleterm.terminal').Terminal
local gitui = Terminal:new({
cmd = 'gitui',
direction = 'float',
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,
})
@ -42,5 +37,4 @@ function _gitui_toggle()
gitui:toggle()
end
vim.api.nvim_set_keymap("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 })
vim.keymap.set('n', '<leader>G', '<cmd>lua _gitui_toggle()<CR>', { noremap = true, silent = true })