Since I have a vertical split, how can I close the left window while the cursor is on the right window?
I know I can go to the next window with Ctrl-w w
and then close it but there might be a faster way.
Thanks
:-q
or :-q!
should do the job.
According to :h CTRL-W_q
:
:q[uit]
:{count}q[uit]
...
If [count] is greater than the last window number the last
window will be closed:
:1quit " quit the first window
:$quit " quit the last window
:9quit " quit the last window
" if there are less than 9 windows opened
:-quit " quit the previews window
:+quit " quit the next window
:+2quit " quit the second next window
I presume previews window
above should read previous window
...
If you have only two windows open, the key combination Ctrl-w o
(or the command :only
) will close the next (and only other) window.
In general, Ctrl-w o
closes all windows except the current window.
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