I am looking for the way to make Vim windows equal only vertically or horizontally, not both at the same time.
For example, I want ^W=
to affect only window width and ^W=|
to affect only its height. Is this possible?
UPDATE
Thanks to @rburny who suggest the appropriate commands. So the final result is:
nmap <c-w>== :set ead=ver ea noea<CR> " set windows equal vertically (^W, =, =)
nmap <c-w>=- :set ead=hor ea noea<CR> " set windows equal horizontally (^W, =, -)
If you want to set windows equally both, just press ^W=
and wait for a moment.
In the taskbar, click the button for the first window you want to position, then hold the Ctrl key and right-click the button for the second window. Select Tile Vertically. Bingo, the two windows are positioned side by side. (If you pick Tile Horizontally then they appear one above the other.)
Press the Windows key and press either the right or left arrow key, moving the open window to the screen's left or right position. Choose the other window you want to view next to the window in step one.
View > Arrange Window > Arrange Horizontally applies to all document windows that are open. However, you can use the SHIFT and CTRL keys in the Window List dialog box to select specific windows and arrange them vertically or horizontally.
Right-click the taskbar and you'll see three window management options — Cascade windows, Show windows stacked, and Show windows side by side.
I'm assuming you don't use equalalways
option, since you want to do such operations manually. In this case, you can hack equalalways
to do what you want:
" make all windows the same height
:set ead=ver ea noea
" make all windows the same width
:set ead=hor ea noea
What these commands do is basically:
equalalways
(vertical / horizontal)equalalways
, which causes the windows in a current tab to be made equal in chosen directionObviously, you can map these commands to any key sequence.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With