I\'m used to my editors autosaving files when they lose focus. I recently switched to MacVim, and I can\'t recreate that behavior. I tried this:
autocmd Bu
autocmd BufLeave,FocusLost * bufdo! call WriteFile()
function WriteFile()
if (&buftype=="") && (expand("%:r") > "") && (&readonly==0)
write
endif
endfunction
This method has a side-effect that, you can only open one unamed buffer. If you open the second one, it would automatically be synced to the content of the first unamed buffer.