title: How can I change what vim does when I (try to) write the buffer?
body: <p>If I read a buffer from an external source, there's no filename associated with the current buffer. That's fine, but what if instead of writing it to a file on disk I want to POST it to a webservice instead?</p>
  
  <p>Can I somehow hook into what <code>:w</code> does, and, depending on file type, change <em>how</em> it writes the buffer?</p>
  
  <p>In this case, it's fairly easy to use a REST API to get the contents of a pesudo-file on our CMS; but now I want a way to send a <code>PUT</code> request back to the API instead of trying to write it to disk.</p>
  
  <p>Ideally the solution would hook into the lowest level possible, so that <code>:up</code> and <code>:x</code> also have the desired effect.</p>