feat(autocmds): rebalance windows on resize

This commit is contained in:
Folke Lemaitre 2023-01-11 16:26:08 +01:00
parent 2ea489c7ba
commit 6674a3accf
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -1,4 +1,4 @@
-- This file is automatically loaded by plugins.config
-- This file is automatically loaded by plugins.init
-- Check if we need to reload the file when it changed
vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, { command = "checktime" })
@ -10,6 +10,13 @@ vim.api.nvim_create_autocmd("TextYankPost", {
end,
})
-- resize splits if window got resized
vim.api.nvim_create_autocmd({ "VimResized" }, {
callback = function()
vim.cmd("tabdo wincmd =")
end,
})
-- go to last loc when opening a buffer
vim.api.nvim_create_autocmd("BufReadPost", {
callback = function()