Autowrite VIM buffers after <alt-tab>

macvim, vim

Solution

You want:

autocmd FocusLost * :wall

In your .vimrc

I just tried it and it seems to work.

Problem

How can I configure vim to autowrite buffers after switching with alt-tab to another application?

Original source