title: How to replace the contents of the current buffer with the contents of a file?
body: <p>I have an external script that takes a Javascript file and automatically fixes some style issues, I want to apply it to the current buffer right before writing (<code>BufWritePre,FileWritePre</code>).</p>
  
  <p>So my idea is to:</p>
  
  <ul>
  <li><code>w /tmp/foo</code> Write the current buffer contents to a temporary file </li>
  <li><code>silent !fixStyle /tmp/foo</code> Run the script on that file.</li>
  <li>Replace the contents of the current buffer with the contents of <code>/tmp/foo</code></li>
  </ul>
  
  <p>The thing is that I don't know how to do the third step.</p>