~/.vimrc I have at the moment:
autocmd BufLeave,FocusLost * nested silent! wall
Which most of the time works as I would like, however sometimes it seems saving simply stops working (for a particular
gvim window, all tabs): when I alt-tab away from the window changes aren't saved. It does seem as though changing to a different tab saves the changes to the buffer, so perhaps
FocusLost in particular is not firing?
The only way to get it working again is to close gvim and re-open my files.
I'm not sure how to go about starting to debug this.
EDIT: I've noticed that if I do a
:autocmd FocusLost * echo "lost focus" in a broken gvim session nothing is printed when I alt-tab away, while the message is printed as expected in windows where my autosaving is working as expected.