Closed vnea closed 10 months ago
I found a way to do it but I think this is a dirty solution:
vim.keymap.set("n", "<C-k>", function()
local lazygit = require("toggleterm.terminal").Terminal:new({
cmd = "lazygit",
hidden = true,
direction = "float",
float_opts = {
-- Enable full screen
width = 9999,
height = 9999,
},
})
lazygit:toggle()
end)
@vnea you are in control of the terminal size so as you have done you can control this yourself I'd suggest using something like vim.o.columns
and vim.o.rows
Thank you, it works!
Just for information, vim.o.rows
does not exist: I had to use vim.o.lines
.
Here is my final configuration:
vim.keymap.set("n", "<Leader>k", function()
local lazygit = require("toggleterm.terminal").Terminal:new({
cmd = "lazygit",
hidden = true,
direction = "float",
-- Enable full screen: https://github.com/akinsho/toggleterm.nvim/issues/505
float_opts = {
width = vim.o.columns,
height = vim.o.lines,
},
})
lazygit:toggle()
end)
Hello.
Is it possible to open the terminal in full screen when using the float direction?
Thank you.