30

I know I can use :new to open a new buffer in a split window (defined by set splitbelow and set splitright).

But how can I just open a new, empty buffer without opening it in a split?

muru
  • 24,838
  • 8
  • 82
  • 143
hgiesel
  • 1,944
  • 2
  • 16
  • 25

2 Answers2

37

You can use :enew. See :h :enew:

Edit a new, unnamed buffer. This fails when changes have been made to the current buffer, unless 'hidden' is set or 'autowriteall' is set and the file can be written.

And you can use :enew! to discard unsaved changes in the current buffer.

statox
  • 49,782
  • 19
  • 148
  • 225
5

Vim also offers :tabnew, which opens a new, unnamed buffer in a new tab allows you to easily switch between buffers (tabs) using gt and gT. This consumes the full width of the editor, albeit, technically in a different window (in a different tab).

Corrected from romainl's comment

jpaugh
  • 284
  • 1
  • 8