VIM create new window above the current or on the left side as default. To use VIM more naturally, I want it to work oppositely, and I have set
:set splitright
:set splitbelow
This works when I split a window using command
:split
or
:vsplit
However, this fails when I create a new empty window using command
:new
or
:vnew
Is there any solution for the second situation?
You have only to add "below" before the command:
:below new
:below vnew
and from :help below
:rightb[elow] {cmd}
:bel[owright] {cmd}Execute {cmd}. If it contains a command that splits a window, it will be opened right (vertical split) or below (horizontal split) the current window. Overrules 'splitbelow' and 'splitright'. Doesn't work for |:execute| and |:normal|.
For the mapping discussed in the comments you can use this one:
:cnoremap new ^Bbelow ^Enew
you get:
^B by typing ctrl+v ctrl+ b
^E by ctrl+v ctrl+ e
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