diff --git a/lua/custom/keymaps.lua b/lua/custom/keymaps.lua index a11ddd5..4f534c9 100644 --- a/lua/custom/keymaps.lua +++ b/lua/custom/keymaps.lua @@ -91,3 +91,14 @@ keymap.set('n', 'v', [[:lua move_to_vertical_split()]], { noremap = -- select a session to load keymap.set("n", "", 'Telescope persisted', { silent = true }) + +keymap.set("n", "m", function() + local winid = vim.api.nvim_get_current_win() + local wininfo = vim.fn.getwininfo(winid)[1] + + if wininfo and wininfo.wincol > vim.o.columns / 2 then + vim.cmd("wincmd H") -- Move to the left if currently on the right + else + vim.cmd("wincmd L") -- Move to the right if currently on the left + end +end, { desc = "Move buffer between left/right split" })