If I do something like this:

# Write some tmp text
# This tmp file served it's purpose, want to quit this one and open a new one
:e newfile
# E37: No write since last change (add ! to override)

To avoid that I end up doing this:

# Write some tmp text
vim newfile

Am looking for a way to do it without the need to quit vim.

1 Answer 1


You want to add the following line to your vimrc:

set hidden

From :h 'hidden':

'hidden' 'hid'      boolean (default off)
            {not in Vi}
    When off a buffer is unloaded when it is abandoned.  When on a
    buffer becomes hidden when it is abandoned.

This option allows you to change of buffer even if the modifications were not saved.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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