This is a follow-up question from this Question and Answer.
Is it possible, and if so how, to open two (or more) new empty buffers in Vim (without associating them to a file), such that they both take on the whole window? (And such that you can move among them with :bprev / :bnext
, i.e. in the exact same way, as if you did :badd <filename>
?)
In other words, I don't want splits and tabs, just "normal" buffers.
I tried :enew
twice, but the second buffer discards the first one...
To put it in a different way: what is the Vim equivalent of opening more new empty files in a GUI text editor?
Still in other words
I want something like this:
:ls
1 #a "[No Name]" line 0
2 %a "[No Name]" line 1
But 1
and 2
should NOT be in split window, both should have their own window, taking up the full screen. (Just as if I did :badd <filename>
. Pity that :badd
without arguments does not open a new empty window.)
:enew|:new
?:set hidden
was the solution I needed. After that, I can just do many:enew
's (as long as I add some content), and they are not lost. I am using terminal vim, in case that matters. (Maybe I'm doing something wrong, but:new
still opens the new buffer for me in a split, i.e. the screen area is split into two equal spaces for the two empty buffers, they don't take up the whole screen.):set hidden
does what I need, it would be worth an answer.