toggleterm.nvim
toggleterm.nvim copied to clipboard
Reevalute size on window resize
I would like to have a terminal that always uses 40% of the available space. I have the following config:
require("toggleterm").setup({
direction = "vertical",
size = function() return vim.o.columns * 0.4 end,
persist_size = false,
})
The config allows that, but only between terminal reopens like:
- Terminal application window in fullscreen
- Open toggleterm
- its 40% width
- Close toggleterm
- Resize Terminal window
- Reopen toggleterm
- its 40% width of the the new Window size
- This is as I like it
Not working is the following:
current behavior
- Terminal application window in fullscreen
- Open toggleterm
- its 40% width
- Resize Terminal window
- Toggleterm still has 40% width of the old window size
desired behavior
I would like to see that on Window Resize also the size parameter gets reevaluated.
- Terminal application window in fullscreen
- Open toggleterm
- its 40% width
- Resize Terminal window
- Toggleterm has 40% width of the new window size