Created
January 22, 2023 16:08
-
-
Save KensoDev/12283a551756893262c2126b5368d310 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local M = {} | |
M.WinMove = function(command_key) | |
local curwin = vim.api.nvim_get_current_win() | |
vim.cmd(string.format("wincmd %s", command_key)) | |
if curwin == vim.api.nvim_get_current_win() then | |
if command_key:match("[jk]") then | |
vim.cmd("wincmd v") | |
else | |
vim.cmd("wincmd s") | |
end | |
vim.cmd(string.format("wincmd %s", command_key)) | |
end | |
end | |
return M |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I call this function like this: