feat(autocmds): rebalance windows on resize

This commit is contained in:
Folke Lemaitre committed 2023-01-11 16:26:08 +01:00
1 parent 2ea489c7ba
commit 6674a3accf
1 file changed
+8 -1
+8 -1
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()