A lot of times, I end up accidentally closing a file with
:wq when I only want to do
:w. Since I work with multiple tabs and windows, the buffer is still there and I can open it with
:ls followed by
:b <number>. However, my previous changes are lost and I cannot undo anymore. Is there any way to set up vim so that it remembers the undo tree of unclosed buffers?
If that is not possible, a way to make vim confirm before quitting on
:wq is also OK.