From 6674a3accf83b86ab9c978db002763f46c3f09bc Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 11 Jan 2023 16:26:08 +0100 Subject: [PATCH] feat(autocmds): rebalance windows on resize --- lua/lazyvim/config/autocmds.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index 08f4beb7..e8e23662 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -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()