0

If I do something like this:

vim
i
# 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:

vim
i
# Write some tmp text
:q!
vim newfile

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

1 Answer 1

2

You want to add the following line to your vimrc:

set hidden

From :h 'hidden':

'hidden' 'hid'      boolean (default off)
            global
            {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 you have read our privacy policy.

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