added keymap to move split pane

main
Mathias Rothenhaeusler 2025-03-28 16:07:03 +01:00
parent 9d28ec0082
commit 2754087154
1 changed files with 11 additions and 0 deletions

View File

@ -91,3 +91,14 @@ keymap.set('n', '<leader>v', [[:lua move_to_vertical_split()<CR>]], { noremap =
-- select a session to load
keymap.set("n", "<F2>", '<cmd>Telescope persisted<CR>', { silent = true })
keymap.set("n", "<leader>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" })