How to open a new file in vim in a new window
Solution 1:
from inside vim, use one of the following
open a new window below the current one:
:new filename.ext
open a new window beside the current one:
:vert new filename.ext
Solution 2:
You can do so from within vim and use its own windows or tabs.
One way to go is to utilize the built-in file explorer; activate it via :Explore
, or :Texplore
for a tabbed interface (which I find most comfortable).
:Texplore
(and :Sexplore
) will also guard you from accidentally exiting the current buffer (editor) on :q
once you're inside the explorer.
To toggle between open tabs when using tab pages use gt
or gT
(next tab and previous tab, respectively).
See also Using tab pages on the vim wiki.