How do I create a new empty buffer?
Answer
:enew
Explanation
The :enew command creates a new unnamed empty buffer in the current window. This is useful for scratch work or starting a new file.
How it works
:enewreplaces the current window content with an empty buffer:newcreates a new window with an empty buffer (horizontal split):vnewcreates a new window with an empty buffer (vertical split)
Example
:enew " New empty buffer in current window
:new " New empty buffer in horizontal split
:vnew " New empty buffer in vertical split
Tips
:w filenamesaves the empty buffer to a file:setlocal buftype=nofilemakes it a scratch buffer (no save prompt):enew!forces creation even with unsaved changes- Useful for temporary calculations or notes
- The empty buffer gets the next available buffer number