Is there any way to specify a width when doing :vsplit? Also, is there a way to increase or decrease the width on a vertically splitted window? Ctrl-w + and Ctrl-w - seems to be working on only horizontally split windows.
Split resizing To increase a window to its maximum width, use Ctrl-w | . In Gvim and vim in terminals with mouse support, it is also possible to use the mouse to resize a window. Simply grab the statusline at the window border and drag it into the desired direction.
To move between splits first press Ctrl-w (I remember this by Control Window, I'm not sure what the official mnemonic is) Then press a directional key to move the cursor to the split you're interested in. Directional key could be the arrows or my preferred home row method.
According to :help :vsplit
, it takes an optional numeric argument as a prefix, e.g., :80vs
. Try it out!
Edit: I guess I forgot to mention. You can control the width with Ctrl-W <
and Ctrl-W >
For more info, read the manual at :help windows
Ctrl-W n < works, replace n with the number of steps you want to move.
You can also use for example 80| to set your current split width to 80 columns
If you want to fix the adjusted windows width, be sure the cursor is placed inside it and set the boolean
:set winfixwidth
This prevents from unwanted automatic resize of the such locked window width if some other window command like CTRL-=
("make all windows equal") is applied.
:set nowinfixwidth
with the cursor placed inside the appropriate window disables the lock.
:mksession
stores the window arrangement as calling vim again from the command line likevim -S Session.vim &
restores it.
Hope this helps...
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