Why does :new create a split? What is the use case for that functionality?

Normally when I open a new scratch buffer, I don't want it to be in a split.


By definition :new creates a new buffer in a new window (aka split). From :h :new:

Create a new window and start editing an empty file in it.

I imagine :enew might be more appropriate if you just want a new/scratch buffer in the current window.

For more help see:

:h :new
:h window
:h :enew
  • Ok, so it is making a new window, not a new buffer. Is there no command to create a new buffer in the existing window? – Tyler Durden Oct 11 '18 at 22:29
  • 4
    @TylerDurden, :enew does exactly that. See :h :enew – Peter Rincker Oct 11 '18 at 22:31
  • Well, according to you, new creates a WINDOW, not a buffer. – Tyler Durden Oct 12 '18 at 2:59
  • 4
    @TylerDurden if you read the :help new documentation, further it has "This behaves like a ":split" first, and then an ":enew" command.". Also, it's not just "according to Peter", this is the official help that says it creates a new window. But more specifically it clearly creates an empty buffer and a new window that's pointing to that buffer. – icc97 Oct 12 '18 at 8:49
  • 2
    @TylerDurden normally when I want a scratch buffer, I want it in a split, as I want to see the current file too. – muru Oct 12 '18 at 16:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.