tags:

views:

43

answers:

1

Hi,

In Vim, the :enew command has a really irritating behavior - after I create a new file, type something and save it, an empty buffer/file is still present. Why is that and is there any way to prevent it? I'm tired of having to close all these empty buffers all the time.

Thanks!

+2  A: 

Your question doesn't make any sense, :enew only creates one new empty buffer and you say you are already writing text and saving it. It sounds like you are starting up vim without specifying a file, and using :enew as your first command, in which case you would then have two empty buffers. Why not use the new buffer that vim creates on startup?

Btw, :set confirm makes it easier to discard unused buffers.

too much php
You're right, it wasn't an enew problem. I should have investigated more before asking. The problem was that I had a "save" shortcut mapped to `:browse confirm saveas`. Changing that to `:browse confirm w` solves the issue. Thanks for your help.
Amati