title: Vim auto commands: writing a read-only file?
body: <p>I'm using Perforce with Vim on Windows.
  I currently have an auto command set up to open a read-only file for edit when changing it:</p>
  
  <pre><code>au FileChangedRO * !p4 edit &lt;afile&gt;
  </code></pre>
  
  <p>Is there any way to set up a similar auto command to execute <code>p4 edit</code> when attempting to <em>write</em>  a read-only file rather than edit it?</p>