29.05.2025

This commit is contained in:
Alexander Neonxp Kiryukhin 2025-05-29 14:53:31 +03:00
parent cefce84f5e
commit ed137a15ff
Signed by: NeonXP
SSH key fingerprint: SHA256:SVt7TjxbVc87m1QYaQziOJ0N3OCFURv2g76gD/UTTXI
28 changed files with 552 additions and 420 deletions

View file

@ -0,0 +1,97 @@
local M = {}
M.setup = function(opts) end
M.isRightMost = function()
local curWin = vim.fn.winnr()
vim.cmd([[wincmd l]])
local rightWin = vim.fn.winnr()
if curWin == rightWin then
return true
else
vim.cmd([[wincmd h]])
return false
end
end
M.isLeftMost = function()
local curWin = vim.fn.winnr()
vim.cmd([[wincmd h]])
local leftWin = vim.fn.winnr()
if curWin == leftWin then
return true
else
vim.cmd([[wincmd l]])
return false
end
end
M.isBottomMost = function()
local curWin = vim.fn.winnr()
vim.cmd([[wincmd j]])
local bottomWin = vim.fn.winnr()
if curWin == bottomWin then
return true
else
vim.cmd([[wincmd k]])
return false
end
end
M.isTopMost = function()
local curWin = vim.fn.winnr()
vim.cmd([[wincmd k]])
local topWin = vim.fn.winnr()
if curWin == topWin then
return true
else
vim.cmd([[wincmd j]])
return false
end
end
M.ResizeLeft = function()
if M.isRightMost() then
if not M.isLeftMost() then
vim.cmd([[wincmd 5 >]])
end
else
vim.cmd([[wincmd 5 <]])
end
end
M.ResizeRight = function()
if M.isRightMost() then
if not M.isLeftMost() then
vim.cmd([[wincmd 5 <]])
end
else
vim.cmd([[wincmd 5 >]])
end
end
M.ResizeUp = function()
if M.isBottomMost() then
if not M.isTopMost() then
vim.cmd([[wincmd 5 +]])
else
vim.cmd([[wincmd 5 -]])
end
else
vim.cmd([[wincmd 5 -]])
end
end
M.ResizeDown = function()
if M.isBottomMost() then
if not M.isTopMost() then
vim.cmd([[wincmd 5 -]])
else
vim.cmd([[wincmd 5 +]])
end
else
vim.cmd([[wincmd 5 +]])
end
end
return M