When I'm in a modified buffer and try to open a file using :e otherFile
I get
E37: No write since last change (add ! to override)
Since this happens fairly often, I'd like to automatically save the current file before opening the new one.
That's why I added this to my vimrc
:
autocmd BufLeave * silent! wall
But this autocommand doesn't help when using :e otherFile
.
Using Neovim v0.4.3
:h 'hidden'
?:set hidden
and:set autowriteall
in an answer?:h 'hidden'
and:h 'autowriteall'
, then try both (make sure only one of them is set), you should see the difference immediately, won't cost more 15 mins.hidden
andautowriteall
alternatingly but couldn't tell the difference in behavior. In both cases the buffer that I was leaving was saved.'hidden'
won't work if'autowrite'
or'autowriteall'
is on.