I am looking for a way to toggle between these two layouts:
-------
| | |
-------
-------
| |
-------
| |
-------
I only have two windows and I need to switch the layout often. I need a solution that will preserve the aspect ratio of windows in both horizontal and vertical split layouts, so I don't end with
---------
| | |
---------
-------
| |
-------
| |
-------
---------
| | |
---------
after toggling twice.
If this isn't possible with some oneliner in vimrc, I am willing to start using a plugin that offers this functionality, so feel free to suggest it.
Edit: I am familiar with Ctrl-W + H/J/K/L but that doesn't preserve aspect ratio of windows.
CTRL-W_t
+CTRL-W_K
(to horizontal), andCTRL-W_t
+CTRL-W_H
(to vertical). stackoverflow.com/questions/1269603/…CTRL-w_=
)?:h getwininfo()
), but I can't find a way to keep track of how they split (verticallyXhorizontally). I may resort to two commands... Let me know if you find something, or else I'll come back whenever I've something working. (: