Get vim to modify the file instead of moving the new version on it?

vim

Solution

You can do this:

:set backupcopy=yes

Problem

I want my app to update automatically when I save my files. So I use inotify (ubuntu) to create watchers that detect the events. The issue is vim overwrites the file instead of updating it. So my watcher is lost after the first update. I wonder, is there a way to setup vim so it doesn't use swap files and updates directly the file ? (I tried `:set noswapfile` and the `-n` option, that removes the swap file without changing the behaviour)

Original source