title: Atomic write with Vim
body: <p>Can I configure Vim so it does an atomic write?</p>
  
  <p>The default Vim behavior is:</p>
  
  <ul>
  <li>move <code>file.txt</code> to <code>file.txt~</code></li>
  <li>write buffer contents to <code>file.txt</code></li>
  </ul>
  
  <p>But this causes some problem with <code>compass watch</code> for example</p>
  
  <p>I would like behavior like:</p>
  
  <ul>
  <li>write buffer contents to <code>file.txt~</code></li>
  <li>move <code>file.txt~</code> to <code>file.txt</code></li>
  </ul>
  
  <p>I've looked at the <a href="http://vimdoc.sourceforge.net/htmldoc/options.html#%27backup%27" rel="noreferrer">backup</a>, <a href="http://vimdoc.sourceforge.net/htmldoc/options.html#%27backupcopy%27" rel="noreferrer">backupcopy</a> and <a href="http://vimdoc.sourceforge.net/htmldoc/options.html#%27writebackup%27" rel="noreferrer">writebackup</a> options but I can't get Vim configured as I want.</p>